Merge pull request #942 from sharetribe/remove-plain-text-parts-from-emails

Remove plain text parts from emails
This commit is contained in:
Antti Salmivaara 2018-10-23 14:41:27 +03:00 committed by GitHub
commit 83a18b71af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 7 additions and 254 deletions

View file

@ -13,6 +13,9 @@ way to update this template, but currently, we follow a pattern:
---
## Upcoming version 2018-10-XX
* [remove] Removed plain text parts of email templates.
[#942](https://github.com/sharetribe/flex-template-web/pull/942)
* [add] Add referrer policy due tokens in URL on PasswordResetPage and EmailVerificationPage.
[#940](https://github.com/sharetribe/flex-template-web/pull/940)
* [add] Added initial documentation about our Redux setup.

View file

@ -9,15 +9,14 @@ automatically. Marketplace owner needs to notify the Sharetribe team.
## Template parts
A template consists of three files:
A template consists of two files:
* `TEMPLATE_NAME-subject.txt` - holds the mail Subject line template
* `TEMPLATE_NAME-text.txt` - holds the template for the plain text version of the mail
* `TEMPLATE_NAME-html.html` - contains the template for the HTML version of the mail
All the parts are mandatory. All emails that are sent from the marketplace contain both the plain
text and HTML variants and the recipient's mail client is free to choose which one to visualize and
how.
Both parts are mandatory. All emails that are sent from the marketplace contain both the HTML and plain
text variants and the recipient's mail client is free to choose which one to visualize and
how. The text version is automatically generated from the HTML template.
## Template syntax
@ -39,19 +38,6 @@ Example html:
</html>
```
Example text version:
```
Hello {{recipient.first-name}},
Your {{marketplace.name}} account's email address was changed.
If you didn't make this change, please contact us.
Best regards,
The {{marketplace.name}} team
```
Variables within `{{ }}` are expanded and escaped, so that they are safe to place inside HTML
content. As seen above, some variables have nested values, which can be accessed with dot `.`
operator.

View file

@ -1,30 +0,0 @@
{{~#*inline "format-money"~}}
{{money-amount money}} {{money.currency}}
{{~/inline~}}
{{~#*inline "format-date"~}}
{{date date format="MMM d, YYYY"}}
{{~/inline~}}
Your booking request was accepted!
{{#with transaction~}}
{{provider.display-name}} has accepted your booking request for {{listing.title}} from {{> format-date date=booking.start}} to {{> format-date date=booking.end}}.
We have charged {{> format-money money=payin-total}} from your credit card. Here's your receipt.
Payment
{{#each line-items~}}
{{~#contains include-for "customer"~}}
{{~#eq "day" code~}}
{{> format-money money=unit-price}} x {{number quantity}} {{inflect quantity "day" "days"}}: {{> format-money money=line-total}}
{{/eq~}}
{{~#eq "night" code~}}
{{> format-money money=unit-price}} x {{number quantity}} {{inflect quantity "night" "nights"}}: {{> format-money money=line-total}}
{{/eq~}}
{{~/contains~}}
{{/each~}}
Payment total: {{> format-money money=payin-total}}
{{~/with}}

View file

@ -1,12 +0,0 @@
{{~#*inline "format-date"~}}
{{date date format="MMM d, YYYY"}}
{{~/inline~}}
Your booking request has expired.
{{#with transaction~}}
Unfortunately {{provider.display-name}} didn't respond to your booking request for {{listing.title}} from {{> format-date date=booking.start}} to {{> format-date date=booking.end}} on time, so the request has expired. You have not been billed.
{{~/with}}
Try to book something else instead: {{marketplace.url}}

View file

@ -1,12 +0,0 @@
{{~#*inline "format-date"~}}
{{date date format="MMM d, YYYY"}}
{{~/inline~}}
Your booking request was declined.
{{#with transaction~}}
Unfortunately {{provider.display-name}} decided to decline your booking request for {{listing.title}} from {{> format-date date=booking.start}} to {{> format-date date=booking.end}}. You have not been billed.
{{~/with}}
Try to book something else instead: {{marketplace.url}}

View file

@ -1,8 +0,0 @@
Hello {{recipient.first-name}},
Your {{marketplace.name}} account's email address was changed.
If you didn't make this change, please contact us.
Best regards,
The {{marketplace.name}} team

View file

@ -1,32 +0,0 @@
{{~#*inline "format-money"~}}
{{money-amount money}} {{money.currency}}
{{~/inline~}}
{{~#*inline "format-date"~}}
{{date date format="MMM d, YYYY"}}
{{~/inline~}}
{{#with transaction~}}
You have been paid {{> format-money money=payout-total}}
We have sent you {{> format-money money=payout-total}} for the booking of {{listing.title}} from {{> format-date date=booking.start}} to {{> format-date date=booking.end}} by {{customer.display-name}}. It might take up to 7 days for the money to reach your bank account.
Here's the breakdown.
Payment
{{#each line-items~}}
{{~#contains include-for "provider"~}}
{{~#eq "day" code~}}
{{> format-money money=unit-price}} x {{number quantity}} {{inflect quantity "day" "days"}}: {{> format-money money=line-total}}
{{/eq~}}
{{~#eq "night" code~}}
{{> format-money money=unit-price}} x {{number quantity}} {{inflect quantity "night" "nights"}}: {{> format-money money=line-total}}
{{/eq~}}
{{~#eq "provider-commission" code~}}
{{marketplace.name}} fee: {{> format-money money=line-total}}
{{/eq~}}
{{~/contains~}}
{{/each~}}
You earn: {{> format-money money=payout-total}}
{{~/with}}

View file

@ -1,35 +0,0 @@
{{~#*inline "format-money"~}}
{{money-amount money}} {{money.currency}}
{{~/inline~}}
{{~#*inline "format-date"~}}
{{date date format="MMM d, YYYY"}}
{{~/inline~}}
{{#with transaction~}}
Please respond to a request by {{customer.display-name}}
Good news! {{customer.display-name}} just requested to book {{listing.title}} from {{> format-date date=booking.start}} to {{> format-date date=booking.end}}. Here's the breakdown.
Payment
{{#each line-items~}}
{{~#contains include-for "provider"~}}
{{~#eq "day" code~}}
{{> format-money money=unit-price}} x {{number quantity}} {{inflect quantity "day" "days"}}: {{> format-money money=line-total}}
{{/eq~}}
{{~#eq "night" code~}}
{{> format-money money=unit-price}} x {{number quantity}} {{inflect quantity "night" "nights"}}: {{> format-money money=line-total}}
{{/eq~}}
{{~#eq "provider-commission" code~}}
{{marketplace.name}} fee: {{> format-money money=line-total}}
{{/eq~}}
{{~/contains~}}
{{/each~}}
You earn: {{> format-money money=payout-total}}
You need to accept the request by {{> format-date date=delayed-transition.run-at}}. Otherwise the request will be expired and you won't get paid. If the booked dates won't work for you, you can also choose to decline the request.
Accept or decline the booking: {{marketplace.url}}/sale/{{url-encode id}}/details
{{~/with}}

View file

@ -1,15 +0,0 @@
{{#with message~}}
You have a new message from {{sender.display-name}}
"{{content}}"
{{#eq recipient-role "customer"~}}
Reply to {{sender.display-name}}: {{marketplace.url}}/order/{{url-encode transaction.id}}/details
{{/eq~}}
{{#eq recipient-role "provider"~}}
Reply to {{sender.display-name}}: {{marketplace.url}}/sale/{{url-encode transaction.id}}/details
{{/eq~}}
{{~/with}}

View file

@ -1,8 +0,0 @@
Hello {{recipient.first-name}},
Your {{marketplace.name}} account's password was changed.
If you didn't make this change, please contact us.
Best regards,
The {{marketplace.name}} team

View file

@ -1,12 +0,0 @@
Hello {{recipient.first-name}},
You have indicated that you have forgotten your password for {{marketplace.name}}. Click the following link to reset your password:
{{marketplace.url}}/reset-password?t={{form-encode password-reset.token}}&e={{form-encode password-reset.email-address}}
If you don't use this link within 1 hour, it will expire. You can request a new password reset link, if you need to.
If you didn't request this, please ignore this email. Your password won't be changed until you use the link above to set a new one.
Best regards,
The {{marketplace.name}} team

View file

@ -1,9 +0,0 @@
{{~#with transaction~}}
How was your experience with {{listing.title}}? Write a review!
You recently booked {{listing.title}} from {{provider.display-name}}. Please write a review to describe your experience. Reviews are important part of the {{marketplace.name}} community.
Leave a review: {{marketplace.url}}/order/{{url-encode id}}/details
{{~/with~}}

View file

@ -1,14 +0,0 @@
{{~#with transaction~}}
{{other-party.display-name}} wrote you a review. Here's what they wrote.
{{#each reviews~}}
{{#eq recipient.id subject.id}}"{{content}}"{{/eq}}
{{~/each}}
The review has been published on your {{marketplace.name}} profile.
View your profile: {{marketplace.url}}/u/{{url-encode recipient.id}}
{{~/with~}}

View file

@ -1,10 +0,0 @@
{{~#with transaction~}}
Find out what {{other-party.display-name}} wrote!
{{other-party.display-name}} has left you a new review. To see what they wrote, please leave them a review to describe your experience.
Leave a review: {{marketplace.url}}/{{#eq recipient-role "customer"}}order{{else}}sale{{/eq}}/{{url-encode id}}/details
{{~/with~}}

View file

@ -1,9 +0,0 @@
{{~#with transaction~}}
How was your experience with {{customer.display-name}}? Write a review!
{{customer.display-name}} recently booked {{listing.title}} from you. Please write {{customer.display-name}} a review to describe your experience. Reviews are important part of the {{marketplace.name}} community.
Leave a review: {{marketplace.url}}/sale/{{url-encode id}}/details
{{~/with~}}

View file

@ -1,6 +0,0 @@
Hello {{recipient.first-name}},
Welcome to {{marketplace.name}}!
Best regards,
The {{marketplace.name}} team

View file

@ -1,12 +0,0 @@
Hello {{recipient.first-name}},
To complete your email address change in {{marketplace.name}}, verify your email by clicking the link below:
{{marketplace.url}}/verify-email?t={{form-encode email-verification.token}}
Alternatively, you can copy the link to your browser's address bar.
If you don't use this link within 2 days, it will expire. You can request a new verification link, if you need to.
Best regards,
The {{marketplace.name}} team

View file

@ -1,12 +0,0 @@
Hello {{recipient.first-name}},
To complete your signup to {{marketplace.name}}, verify your email by clicking the link below:
{{marketplace.url}}/verify-email?t={{form-encode email-verification.token}}
Alternatively, you can copy the link to your browser's address bar.
If you don't use this link within 2 days, it will expire. You can request a new verification link, if you need to.
Best regards,
The {{marketplace.name}} team