feat: optional override for Postmark email From: field #429
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
originally PR'd as #354, opening a new PR to see if the CI failure is a result of that PR coming from a remote fork
original PR message:
This change allows an optional POSTMARK_SENDER env variable to be set alongside the existing POSTMARK_TOKEN in case the configure token's account is not approved for sending from the default (main/real) domain. Without this the "From: …" sender email address is hardcoded at quite a low-level which makes it difficult for code re-use.
With this change, I'm enabled to set up a local environment and test from my own Postmark account without needing production keys. (Since I don't own or control the domain, sending an email from [email protected] gets rejected by the Postmark server with an error if requested via my own API token.)
I have avoided touching most of the many places where environment variables are handled because most of those deal in terms of required env. This new config variable is optional: available for those who need it, but if not set, the email logic simply stays defaulted to what was the hardcoded sender.