Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: optional override for Postmark email From: field #354

Merged
merged 4 commits into from
Feb 9, 2023

Conversation

natevw
Copy link
Contributor

@natevw natevw commented Jan 17, 2023

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 anything@dag.house 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.

allows an optional POSTMARK_SENDER env variable to be set alongside POSTMARK_TOKEN in case token is not approved for sending from the main/real domain. this enables me to set up a local environment and test from my own Postmark account without needing production keys
packages/access-api/src/config.js Outdated Show resolved Hide resolved
@alanshaw
Copy link
Member

@natevw would you mind fixing the lint error reported by CI 🙏?

@alanshaw
Copy link
Member

alanshaw commented Feb 8, 2023

Secret CF_TOKEN is required, but not provided while calling.

Looks like we need to update the cloudflare token?

@travis travis temporarily deployed to dev February 9, 2023 03:13 — with GitHub Actions Inactive
@travis travis merged commit f6b2350 into storacha:main Feb 9, 2023
travis pushed a commit that referenced this pull request Feb 16, 2023
🤖 I have created a release *beep* *boop*
---


##
[4.10.0](access-api-v4.9.0...access-api-v4.10.0)
(2023-02-16)


### Features

* add support for access/authorize and update
([#392](#392))
([9c8ca0b](9c8ca0b)),
closes [#386](#386)
* optional override for Postmark email From: field
([#354](#354))
([f6b2350](f6b2350))
* rm /reproduce-cloudflare-error route
([#426](#426))
([99cbd2f](99cbd2f))
* rm upload-api-proxy ability to route to separate environment audiences
([#407](#407))
([5cfe274](5cfe274))


### Bug Fixes

* align postmark/welcome.txt with .html version
([#431](#431))
([a53d6e6](a53d6e6))
* avoid email delegation via GET request
([#430](#430))
([d282d6a](d282d6a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
gobengo pushed a commit that referenced this pull request Apr 11, 2023
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
`anything@dag.house` 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.

---------

Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
Co-authored-by: Travis Vachon <travis.vachon@gmail.com>
gobengo pushed a commit that referenced this pull request Apr 11, 2023
🤖 I have created a release *beep* *boop*
---


##
[4.10.0](access-api-v4.9.0...access-api-v4.10.0)
(2023-02-16)


### Features

* add support for access/authorize and update
([#392](#392))
([bf41071](bf41071)),
closes [#386](#386)
* optional override for Postmark email From: field
([#354](#354))
([00db0ec](00db0ec))
* rm /reproduce-cloudflare-error route
([#426](#426))
([158f309](158f309))
* rm upload-api-proxy ability to route to separate environment audiences
([#407](#407))
([eefb6c6](eefb6c6))


### Bug Fixes

* align postmark/welcome.txt with .html version
([#431](#431))
([0d72795](0d72795))
* avoid email delegation via GET request
([#430](#430))
([e0f67e8](e0f67e8))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
gobengo pushed a commit that referenced this pull request Apr 11, 2023
per #354 (comment) feedback

Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants