Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending Enquiry emails using mailgun recipient to {first: "Admin", last: "user"} #4793

Open
kaaljabr opened this issue Sep 7, 2018 · 2 comments
Milestone

Comments

@kaaljabr
Copy link

kaaljabr commented Sep 7, 2018

Hi,

I am facing an issue when sending enquiries by email using mailgun. When I receive them I get into this issue:

to: { first: "Admin", last: "user" } [email protected]

And when I look into my inbox. I see the to field showing {

I found the issue it is here:

in transport/mailgun/processAddress.js
// process { name: 'Jed Watson', email: '[email protected]' } into 'name <email>' format if (data.name && data.email) { rtn.address = data.name + ' <' + data.email + '>'; }

It should be

rtn.address = data.name.full + ' <' + data.email + '>';

@stennie stennie added this to the 4.0.1 milestone Sep 10, 2018
@stennie
Copy link
Contributor

stennie commented Sep 10, 2018

@kaaljabr This looks like issue #30 in the keystone-email package (which you've also commented on). The bug will have to be addressed there, but I'll leave this issue as a placeholder for updating the keystone-email dependency when a fix is available.

Note: it looks like the intent was to support a generic name object rather than assuming objects would be a Keystone Name field (which includes the full() virtual to concatenate the names).

Regards,
Stennie

@kaaljabr
Copy link
Author

Here is a workaround in case someone gets into this.

admins = admins.map(admin => {
	const {
		name: {
			full: name,
		},
		email: email,
	} = admin;
	return { name: name, email: email };
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants