You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On one hand, storing templates in SES would allow us to change templates without redeploying the app. We would only need to redeploy the app if a template added a new substitution (in which case we would increment the version number in the template name, to avoid storing a template that is incompatible with the deployed app). SES also errors if not all tags are replaced (we had some uncaught typos in afa1aee).
On the other hand, needing to upload templates to S3 when testing templates in development is annoying. Uploading templates is also overhead, for which we have no automation. Notably, we currently have a SES layout + local template pattern. If everything were on SES, we'd need each template to be a full HTML document. (Any other reasons to prefer local templates?)
We could get the advantages of SES by:
Keeping layouts and partials separate locally.
Having a build script that combines the layout with the partials, and uploads them. (No tags will be filled in, in this case.)
The templates would follow a filename pattern (ideally matching the MessageType enum – and ideally the mail functions would also match this enum) starting with the environment and ending with a version number, like prod.message-type.es.v123.html.
In terms of SES actions, the build script would:
Call ListTemplates.
Determine the maximum version of each template whose name matches a local template.
Call GetTemplate on each latest version.
Compare whether the content is different than the local version. If not, skip that template.
Compare the tags in each version.
If the tags are the same, replace the template. If the tags are different, upload a newer version.
If the local template has no remote version, it is uploaded as v1.
For development, the templates would be written to dev.type.es.v123.html, etc.
Anyway, just an idea, no urgency to develop this.
The text was updated successfully, but these errors were encountered:
Noting that images are currently stored in credere-frontend. As noted at https://credere.readthedocs.io/en/latest/aws/cloudfront.html, these image files should not be changed (and if they are, CloudFront needs to be invalidated) and should not be removed (because then old emails will fail to retrieve the image, unless the email was sent after we setup CloudFront and the image is still in the CloudFront cache).
To ease cognitive load, we should probably also establish a naming scheme for images, e.g. message-type.es.v123.png if the image is directly relevant to that message type, or name.es.v123.png if it's generic. The version numbers are necessary for the reasons stated above.
On one hand, storing templates in SES would allow us to change templates without redeploying the app. We would only need to redeploy the app if a template added a new substitution (in which case we would increment the version number in the template name, to avoid storing a template that is incompatible with the deployed app). SES also errors if not all tags are replaced (we had some uncaught typos in afa1aee).
On the other hand, needing to upload templates to S3 when testing templates in development is annoying. Uploading templates is also overhead, for which we have no automation. Notably, we currently have a SES layout + local template pattern. If everything were on SES, we'd need each template to be a full HTML document. (Any other reasons to prefer local templates?)
We could get the advantages of SES by:
mail
functions would also match this enum) starting with the environment and ending with a version number, likeprod.message-type.es.v123.html
.In terms of SES actions, the build script would:
For development, the templates would be written to
dev.type.es.v123.html
, etc.Anyway, just an idea, no urgency to develop this.
The text was updated successfully, but these errors were encountered: