Differing "From" Addresses from newsletter emails and test emails

Hello all, I have a blog running on a DO droplet.

It’s running the latest Ghost, on a DO Droplet. I use mailgun for my mailer.
I have the API set through the desktop app with the display address as “newsletter@lifesic.com

and the SMTP set through config.production.json as follows:

“mail”: {
“transport”: “SMTP”,
“from”: ““Life(sic)” newsletter@lifesic.com”,
“options”: {
“service”: “Mailgun”,
“auth”: {
“user”: “postmaster@lifesic.com”,
“pass”: “xxx”

I can send emails through both services. Here’s the odd part. When I send an email from the Labs menu in the native app, I get the From address as “Life(sic)”. When I send a test newsletter as though I am writing a post, I only get the From address as “Life”… any ideas?? Help greatly appreciated.

Untitled

1 Like

Hey @Brandon_Davis :wave:

I believe the “Life” value comes from the site name, whereas the “Life(sic)” comes from the mail config you’ve set. You should be able to amend the from label in your config to match the site title :+1:

The site title actually is Life(sic)

I don’t see in my config.prod.json where I can set the site name. In the native desktop app, I have the correct name entered in: General Settings -> Title & description -> The name of your site

I know that those parentheses wreak havoc in JSON. If I try to alter the name of the site to escape the parentheses i.e., Life(sic) it errors out when I attempt to send a test newsletter. Here is what Mailgun is seeing:

image

They do all go through. Is it possible to amend the From label to match the config file and not the site title?

So some updates on this (if anyone can help).

  1. The newsletter email function is capturing the “From” email variable from the “Title” field in General Settings within Ghost.
  2. If your site title has JSON-unfriendly characters such as Life(sic) it will not escape those characters when fetching the variable.
  3. If you manually escape them and add parentheses, it will capture the “From” address appropriately. In my case, I entered:
    “Life(sic)” and the “From” address ended up as:
    image

but the title is now “Life(sic)” with the parentheses AND quotations.

  1. It will not work without the quotations, nor will it work with apostrophes surrounding it (with the ""s).

I would be interested to see if there is a way to solve this without changing core code, or changing my site name (the parentheses matter). I’m currently investigating using Mailgun templates, but we shall see.

So for now, the easiest solution was modifying the source code. Going to:

/var/www/ghost/versions/xxxxxxxxxx(current one)/core/server/services/bulk-email

and modifying the index.js file to basically set the “From” address as a constant fixes the issue for me. I couldn’t find another way to do it. Hopefully, someone does, or the Ghost Team incorporates a fix in a later build.

Hi @Brandon_Davis,

I’ve checked on GitHub and this issue is being tracked here:

I’ve added a comment noting your issue. Following along there is the best way to keep up to date on it’s resolution :blush:

1 Like