mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
1b85b9244b
no issue - moved duplicated email domain generation from `members-email` controller and `<GhMembersEmailSetting>` to `config.emailDomain` - added `{{from-email-address emailStr}}` helper that will output the passed in emailStr value if it contains an `@` or concat `emailStr@emailDomain` if it doesn't - lets us use `settings.membersFromAddress` to always get a full email address when it could be just a name (`noreply`) or a full address - updated customise email and post email preview templates to use the new helper
15 lines
341 B
JavaScript
15 lines
341 B
JavaScript
import Helper from '@ember/component/helper';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class FullEmailAddressHelper extends Helper {
|
|
@service config;
|
|
|
|
compute([email]) {
|
|
if (email.indexOf('@') > -1) {
|
|
return email;
|
|
}
|
|
|
|
return `${email}@${this.config.emailDomain}`;
|
|
}
|
|
}
|