mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Changed member name to "Anonymous" in emails when not set
refs https://github.com/TryGhost/Team/issues/1664
This commit is contained in:
parent
c63f3eb8c1
commit
38eb755056
1 changed files with 8 additions and 4 deletions
|
@ -83,6 +83,8 @@ class CommentsService {
|
||||||
const to = author.get('email');
|
const to = author.get('email');
|
||||||
const subject = '💬 You have a new comment on one of your posts';
|
const subject = '💬 You have a new comment on one of your posts';
|
||||||
|
|
||||||
|
const memberName = member.get('name') || 'Anonymous';
|
||||||
|
|
||||||
const templateData = {
|
const templateData = {
|
||||||
siteTitle: this.settingsCache.get('title'),
|
siteTitle: this.settingsCache.get('title'),
|
||||||
siteUrl: this.urlUtils.getSiteUrl(),
|
siteUrl: this.urlUtils.getSiteUrl(),
|
||||||
|
@ -91,9 +93,9 @@ class CommentsService {
|
||||||
postUrl: this.urlService.getUrlByResourceId(post.get('id'), {absolute: true}),
|
postUrl: this.urlService.getUrlByResourceId(post.get('id'), {absolute: true}),
|
||||||
commentHtml: comment.get('html'),
|
commentHtml: comment.get('html'),
|
||||||
commentDate: moment(comment.get('created_at')).tz(this.settingsCache.get('timezone')).format('D MMM YYYY'),
|
commentDate: moment(comment.get('created_at')).tz(this.settingsCache.get('timezone')).format('D MMM YYYY'),
|
||||||
memberName: member.get('name'),
|
memberName: memberName,
|
||||||
memberBio: member.get('bio'),
|
memberBio: member.get('bio'),
|
||||||
memberInitials: this.extractInitials(member.get('name')),
|
memberInitials: this.extractInitials(memberName),
|
||||||
accentColor: this.settingsCache.get('accent_color'),
|
accentColor: this.settingsCache.get('accent_color'),
|
||||||
fromEmail: this.notificationFromAddress,
|
fromEmail: this.notificationFromAddress,
|
||||||
toEmail: to,
|
toEmail: to,
|
||||||
|
@ -122,6 +124,8 @@ class CommentsService {
|
||||||
const post = await this.models.Post.findOne({id: reply.get('post_id')});
|
const post = await this.models.Post.findOne({id: reply.get('post_id')});
|
||||||
const member = await this.models.Member.findOne({id: reply.get('member_id')});
|
const member = await this.models.Member.findOne({id: reply.get('member_id')});
|
||||||
|
|
||||||
|
const memberName = member.get('name') || 'Anonymous';
|
||||||
|
|
||||||
const templateData = {
|
const templateData = {
|
||||||
siteTitle: this.settingsCache.get('title'),
|
siteTitle: this.settingsCache.get('title'),
|
||||||
siteUrl: this.urlUtils.getSiteUrl(),
|
siteUrl: this.urlUtils.getSiteUrl(),
|
||||||
|
@ -130,9 +134,9 @@ class CommentsService {
|
||||||
postUrl: this.urlService.getUrlByResourceId(post.get('id'), {absolute: true}),
|
postUrl: this.urlService.getUrlByResourceId(post.get('id'), {absolute: true}),
|
||||||
replyHtml: reply.get('html'),
|
replyHtml: reply.get('html'),
|
||||||
replyDate: moment(reply.get('created_at')).tz(this.settingsCache.get('timezone')).format('D MMM YYYY'),
|
replyDate: moment(reply.get('created_at')).tz(this.settingsCache.get('timezone')).format('D MMM YYYY'),
|
||||||
memberName: member.get('name'),
|
memberName: memberName,
|
||||||
memberBio: member.get('bio'),
|
memberBio: member.get('bio'),
|
||||||
memberInitials: this.extractInitials(member.get('name')),
|
memberInitials: this.extractInitials(memberName),
|
||||||
accentColor: this.settingsCache.get('accent_color'),
|
accentColor: this.settingsCache.get('accent_color'),
|
||||||
fromEmail: this.notificationFromAddress,
|
fromEmail: this.notificationFromAddress,
|
||||||
toEmail: to,
|
toEmail: to,
|
||||||
|
|
Loading…
Add table
Reference in a new issue