diff --git a/core/server/services/members/middleware.js b/core/server/services/members/middleware.js index f477856e56..7e7d555553 100644 --- a/core/server/services/members/middleware.js +++ b/core/server/services/members/middleware.js @@ -90,7 +90,12 @@ const updateMemberData = async function (req, res) { const getMemberSiteData = async function (req, res) { const isStripeConfigured = membersService.config.isStripeConnected(); - + const domain = urlUtils.urlFor('home', true).match(new RegExp('^https?://([^/:?#]+)(?:[/:?#]|$)', 'i')); + const blogDomain = domain && domain[1]; + let supportAddress = settingsCache.get('members_support_address'); + if (!supportAddress.includes('@')) { + supportAddress = `${supportAddress}@${blogDomain}`; + } const response = { title: settingsCache.get('title'), description: settingsCache.get('description'), @@ -108,7 +113,7 @@ const getMemberSiteData = async function (req, res) { portal_button_icon: settingsCache.get('portal_button_icon'), portal_button_signup_text: settingsCache.get('portal_button_signup_text'), portal_button_style: settingsCache.get('portal_button_style'), - members_support_address: settingsCache.get('members_support_address') + members_support_address: supportAddress }; // accent_color is currently an experimental feature