Skip to content

Commit

Permalink
fix(email): omit links when application URL is not configured (#1806)
Browse files Browse the repository at this point in the history
Co-authored-by: sct <ryan@sct.dev>
  • Loading branch information
TheCatLady and sct committed Jul 13, 2021
1 parent 680ea0c commit 1133a34
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 89 deletions.
2 changes: 1 addition & 1 deletion server/entity/User.ts
Expand Up @@ -212,7 +212,7 @@ export class User {
},
locals: {
resetPasswordLink,
applicationUrl: resetPasswordLink,
applicationUrl,
applicationTitle,
},
});
Expand Down
22 changes: 2 additions & 20 deletions server/templates/email/generatedpassword/html.pug
Expand Up @@ -75,23 +75,5 @@ div(role='article' aria-roledescription='email' aria-label='' lang='en')
margin-bottom: 20px;\
color: #51545e;\
')
a(href=applicationUrl style='color: #3869d4') Open #{applicationTitle}
tr
td
table.sm-w-full(align='center' style='\
margin-left: auto;\
margin-right: auto;\
text-align: center;\
width: 570px;\
' width='570' cellpadding='0' cellspacing='0' role='presentation')
tr
td(align='center' style='font-size: 16px; padding: 45px')
p(style='\
font-size: 13px;\
line-height: 24px;\
margin-top: 6px;\
margin-bottom: 20px;\
text-align: center;\
color: #a8aaaf;\
')
| #{applicationTitle}
if applicationUrl
a(href=applicationUrl style='color: #3869d4') Open #{applicationTitle}
26 changes: 4 additions & 22 deletions server/templates/email/media-request/html.pug
Expand Up @@ -77,9 +77,9 @@ div(role='article' aria-roledescription='email' aria-label='' lang='en')
| #{extra.value}
table(align='center' cellpadding='0' cellspacing='0' role='presentation')
tr
td
td(style='text-align: center')
a(href=actionUrl style='color: #3869d4')
img(src=imageUrl alt='')
img(src=imageUrl alt='' style='max-width: 50%')
p(style='\
font-size: 16px;\
line-height: 24px;\
Expand All @@ -95,23 +95,5 @@ div(role='article' aria-roledescription='email' aria-label='' lang='en')
margin-bottom: 20px;\
color: #51545e;\
')
a(href=actionUrl style='color: #3869d4') Open in #{applicationTitle}
tr
td
table.sm-w-full(align='center' style='\
margin-left: auto;\
margin-right: auto;\
text-align: center;\
width: 570px;\
' width='570' cellpadding='0' cellspacing='0' role='presentation')
tr
td(align='center' style='font-size: 16px; padding: 45px')
p(style='\
font-size: 13px;\
line-height: 24px;\
margin-top: 6px;\
margin-bottom: 20px;\
text-align: center;\
color: #a8aaaf;\
')
| #{applicationTitle}
if actionUrl
a(href=actionUrl style='color: #3869d4') Open in #{applicationTitle}
37 changes: 11 additions & 26 deletions server/templates/email/resetpassword/html.pug
Expand Up @@ -64,36 +64,21 @@ div(role='article' aria-roledescription='email' aria-label='' lang='en')
' width='570' bgcolor='#ffffff' cellpadding='0' cellspacing='0' role='presentation')
tr
td(style='padding: 45px')
div(style='font-size: 16px; text-align: center; padding-bottom: 14px;')
| A request to reset the password was made. Click
a(href=applicationUrl style='color: #3869d4; padding: 0px 5px;') here
| to set a new password.
div(style='font-size: 16px; text-align: center; padding-bottom: 14px;')
| If you did not request this recovery link you can safely ignore this email.
div(style='font-size: 16px; padding-bottom: 14px;')
p
| We received a request to reset your password.
p
| Please
a(href=resetPasswordLink style='color: #3869d4; padding: 0px 5px;') click here
| to change your #{applicationTitle} password.
p
| If you did not request that your password be reset, you can safely ignore this email.
p(style='\
font-size: 13px;\
line-height: 24px;\
margin-top: 6px;\
margin-bottom: 20px;\
color: #51545e;\
')
a(href=applicationUrl style='color: #3869d4') Open #{applicationTitle}
tr
td
table.sm-w-full(align='center' style='\
margin-left: auto;\
margin-right: auto;\
text-align: center;\
width: 570px;\
' width='570' cellpadding='0' cellspacing='0' role='presentation')
tr
td(align='center' style='font-size: 16px; padding: 45px')
p(style='\
font-size: 13px;\
line-height: 24px;\
margin-top: 6px;\
margin-bottom: 20px;\
text-align: center;\
color: #a8aaaf;\
')
| #{applicationTitle}.
if applicationUrl
a(href=applicationUrl style='color: #3869d4') Open #{applicationTitle}
22 changes: 2 additions & 20 deletions server/templates/email/test-email/html.pug
Expand Up @@ -73,23 +73,5 @@ div(role='article' aria-roledescription='email' aria-label='' lang='en')
margin-bottom: 20px;\
color: #51545e;\
')
a(href=applicationUrl style='color: #3869d4') Open #{applicationTitle}
tr
td
table.sm-w-full(align='center' style='\
margin-left: auto;\
margin-right: auto;\
text-align: center;\
width: 570px;\
' width='570' cellpadding='0' cellspacing='0' role='presentation')
tr
td(align='center' style='font-size: 16px; padding: 45px')
p(style='\
font-size: 13px;\
line-height: 24px;\
margin-top: 6px;\
margin-bottom: 20px;\
text-align: center;\
color: #a8aaaf;\
')
| #{applicationTitle}
if applicationUrl
a(href=applicationUrl style='color: #3869d4') Open #{applicationTitle}

0 comments on commit 1133a34

Please sign in to comment.