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

Generic Vapor Email #2

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

Generic Vapor Email #2

wants to merge 14 commits into from

Conversation

madsodgaard
Copy link
Collaborator

@madsodgaard madsodgaard commented Jun 4, 2020

This PR serves as a discussion and W.I.P for this repository and the API.

EmailClient

So far I've implemented EmailClient that providers must conform to, which allows to send a EmailMessage.

EmailAddress

You specify the sender and recipients with the EmailAddress type, which can be initialized by a string in the following formats:

EmailAddressRepresentable

Another thing I've added is a EmailAddressRepresentable protocol, which can be added to a User for example and then you can do:

let user: User  = ...
let email = EmailMessage(from: "[email protected]", to: user)
req.email.send(email)

@madsodgaard
Copy link
Collaborator Author

Just reposting @mcdappdev reply to the previous PR, as I closed that and opened this one instead.

@madsodgaard this is exciting! I'm def +1 for a repo like this. The only thing I would suggest after perusing the source is making text on VaporEmail optional as well - sometimes people send out only HTML with no text component (although not recommended) and so I think this library shouldn't make any assumptions about that.

@tanner0101 tanner0101 added the enhancement New feature or request label Jul 11, 2020
Copy link
Member

@tanner0101 tanner0101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far. :)

Sources/Email/VaporEmail.swift Outdated Show resolved Hide resolved
Sources/Email/VaporEmail.swift Outdated Show resolved Hide resolved
Sources/Email/Emailable.swift Outdated Show resolved Hide resolved
Base automatically changed from master to main March 12, 2021 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants