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

Template mailer settings query #7

Closed
kat-ms opened this issue Jan 17, 2022 · 1 comment · Fixed by #8
Closed

Template mailer settings query #7

kat-ms opened this issue Jan 17, 2022 · 1 comment · Fixed by #8

Comments

@kat-ms
Copy link
Contributor

kat-ms commented Jan 17, 2022

Great project, have enjoyed using it - thanks!

I've got a query about some of the mailer settings that are used in the project:

It looks like there's an environment variable, SEND_EMAIL checked here:

let actually_send: bool = env::var("SEND_EMAIL", "false").eq("true");

But further down there is some validation that looks for a different environment variable SEND_MAIL:

if std::env::var("SEND_EMAIL").is_err() || std::env::var("SEND_MAIL").unwrap().eq("true") {

Was it intended for there to be two different settings to control separate behaviours? The check also appears to print an error message (that at face value sounds contradictory) if SEND_MAIL is set to true.

@Wulf
Copy link
Owner

Wulf commented Jan 17, 2022

hey @katherine-sussol , thanks for reporting this!

That's a bug 😅. (It should be "SEND_MAIL")

Also, there should be a ! in front of std::env::var("SEND_MAIL").unwrap().eq("true"). It's on this line:
https://github.com/Wulf/create-rust-app/blob/main/template/backend/mail/mod.rs#L65

Feel free to create a PR, otherwise, I can do it as well :-)

We're going to make some changes which make it easier for these bug fixes to propagate to existing create-rust-app projects.

@Wulf Wulf closed this as completed in #8 Jan 17, 2022
AnthonyMichaelTDM referenced this issue in AnthonyMichaelTDM/create-rust-app Nov 29, 2022
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 a pull request may close this issue.

2 participants