Ghost/ghost/admin/app/helpers/full-email-address.js

15 lines
346 B
JavaScript
Raw Normal View History

import Helper from '@ember/component/helper';
import {inject as service} from '@ember/service';
export default class FullEmailAddressHelper extends Helper {
@service config;
2022-04-04 21:26:49 +03:00
compute([email = '']) {
if (email.indexOf('@') > -1) {
return email;
}
return `${email}@${this.config.emailDomain}`;
}
}