Custom From Email address

Can’t use a custom domain for the member from address

Reference https://github.com/TryGhost/Ghost/blob/master/core/server/services/members/api.js

line 206 - 224

transporter: {
                sendMail(message) {
                    if (process.env.NODE_ENV !== 'production') {
                        common.logging.warn(message.text);
                    }
                    let msg = Object.assign({
                        subject: 'Signin',
                        forceTextContent: true
                    }, message);
                    const subscriptionSettings = settingsCache.get('members_subscription_settings');

                    if (subscriptionSettings && subscriptionSettings.fromAddress) {
                        let from = `${subscriptionSettings.fromAddress}@${getDomain()}`;
                        msg = Object.assign({from: from}, msg);
                    }

                    return ghostMailer.send(msg);
                }
            },

The from address is set via the database and automatically append the domain. Whereas we have a mail setting in the config which would be better or at least we should remove the get domain part

The issue

We have the blog on one domain and we use a different email domain for sending emails. However, currently, you can’t change the domain for membership, only before the @

github link

this was raised on github but apparently this isn’t a bug which seems strange as you can change other mail from address

2 Likes