-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
138 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
defmodule CodeCorps.Emails do | ||
alias CodeCorps.Emails.{API, Tasks, Transmissions} | ||
|
||
defdelegate create_templates, to: Tasks | ||
defdelegate update_templates, to: Tasks | ||
|
||
def send_forgot_password_email(user, token) do | ||
user |> Transmissions.ForgotPassword.build(token) |> API.send_transmission | ||
end | ||
|
||
def send_message_initiated_by_project_email(message, conversation) do | ||
message | ||
|> Transmissions.MessageInitiatedByProject.build(conversation) | ||
|> API.send_transmission | ||
end | ||
|
||
def send_organization_invite_email(invite) do | ||
invite |> Transmissions.OrganizationInvite.build |> API.send_transmission | ||
end | ||
|
||
def send_project_approval_request_email(project) do | ||
project | ||
|> Transmissions.ProjectApprovalRequest.build | ||
|> API.send_transmission | ||
end | ||
|
||
def send_project_approved_email(project) do | ||
project |> Transmissions.ProjectApproved.build |> API.send_transmission | ||
end | ||
|
||
def send_project_user_acceptance_email(project_user) do | ||
project_user | ||
|> Transmissions.ProjectUserAcceptance.build | ||
|> API.send_transmission | ||
end | ||
|
||
def send_project_user_request_email(project_user) do | ||
project_user | ||
|> Transmissions.ProjectUserRequest.build | ||
|> API.send_transmission | ||
end | ||
|
||
def send_receipt_email(charge, invoice) do | ||
case charge |> Transmissions.Receipt.build(invoice) do | ||
%SparkPost.Transmission{} = transmission -> | ||
transmission |> API.send_transmission | ||
build_failure -> build_failure | ||
end | ||
end | ||
|
||
def send_reply_to_conversation_email(part, user) do | ||
part | ||
|> Transmissions.ReplyToConversation.build(user) | ||
|> API.send_transmission | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
lib/code_corps/sparkpost/extended_api.ex → lib/code_corps/emails/extended_api.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/code_corps/sparkpost/emails/recipient.ex → lib/code_corps/emails/recipient.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...corps/sparkpost/emails/forgot_password.ex → ...s/emails/transmissions/forgot_password.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...st/emails/message_initiated_by_project.ex → ...smissions/message_initiated_by_project.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...s/sparkpost/emails/organization_invite.ex → ...ails/transmissions/organization_invite.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...rkpost/emails/project_approval_request.ex → ...transmissions/project_approval_request.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...orps/sparkpost/emails/project_approved.ex → .../emails/transmissions/project_approved.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...arkpost/emails/project_user_acceptance.ex → .../transmissions/project_user_acceptance.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
lib/code_corps/sparkpost/emails/receipt.ex → ...ode_corps/emails/transmissions/receipt.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...sparkpost/emails/reply_to_conversation.ex → ...ls/transmissions/reply_to_conversation.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.