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

Suggestion: make contentType enum public #62

Closed
yusufozturk opened this issue Aug 28, 2022 · 3 comments
Closed

Suggestion: make contentType enum public #62

yusufozturk opened this issue Aug 28, 2022 · 3 comments

Comments

@yusufozturk
Copy link
Contributor

First of all, thank you for this great library.

If you can make mail.contentType enum public, we can hold plain text or html formats in enum instead of integer values.

Right now, we do:

// Check Content Type
if message.ContentType == 1 {
  // Set Body HTML String
  email.SetBody(mail.TextHTML, message.Body)
} else {
  // Set Body Plain String
  email.SetBody(mail.TextPlain, message.Body)
}

What I want to do, is setting message.ContentType as mail.ContentType, so I can use directly:

email.SetBody(message.ContentType, message.Body)

If you accept this suggestion, I can prepare a PR.

Thanks.

@xhit
Copy link
Owner

xhit commented Aug 28, 2022

You are right, as a breaking change, you can make a PR where destination is V3.

Thanks

Edit: nevermind, is not a breaking change

@yusufozturk
Copy link
Contributor Author

@xhit opened the PR.

I made the changes with "Rename Symbol", so everything should be okay. Also did some basic tests like sending email, nothing is broken.

Thanks.

@xhit
Copy link
Owner

xhit commented Aug 29, 2022

Done, thanks for the contribution!

@xhit xhit closed this as completed Aug 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

No branches or pull requests

2 participants