All Projects → crisward → mailer

crisward / mailer

Licence: MIT license
Simple Email Sending Client for Mailgun & Sendgrid services in crystal

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to mailer

Laravel Mailbox
Catch incoming emails in your Laravel application
Stars: ✭ 783 (+4793.75%)
Mutual labels:  mailgun, sendgrid
Mailcore
Emailing wrapper for Vapor 3 apps
Stars: ✭ 77 (+381.25%)
Mutual labels:  mailgun, sendgrid
mailcoach-support
Questions and support for Mailcoach
Stars: ✭ 32 (+100%)
Mutual labels:  mailgun, sendgrid
go-mail
📧 A cross platform mail driver for GoLang. Featuring Mailgun, Postal, Postmark, SendGrid, SparkPost & SMTP.
Stars: ✭ 169 (+956.25%)
Mutual labels:  mailgun, sendgrid
Omnimail
Send email across all platforms using one interface
Stars: ✭ 325 (+1931.25%)
Mutual labels:  mailgun, sendgrid
Slmmail
Send mail from Laminas or Mezzio using external mail services.
Stars: ✭ 106 (+562.5%)
Mutual labels:  mailgun, sendgrid
Notify
A dead simple Go library for sending notifications to various messaging services.
Stars: ✭ 727 (+4443.75%)
Mutual labels:  mailgun, sendgrid
wemail
Send Affordable Bulk Email Campaign Through WordPress
Stars: ✭ 19 (+18.75%)
Mutual labels:  mailgun, sendgrid
Django Anymail
Django email backends and webhooks for Amazon SES, Mailgun, Mailjet, Postmark, SendGrid, Sendinblue, SparkPost and more
Stars: ✭ 1,109 (+6831.25%)
Mutual labels:  mailgun, sendgrid
Airform
Functional HTML forms for Front-End Developers.
Stars: ✭ 307 (+1818.75%)
Mutual labels:  mailgun, sendgrid
SlmMail
Send mail from Laminas or Mezzio using external mail services.
Stars: ✭ 107 (+568.75%)
Mutual labels:  mailgun, sendgrid
MailHookBundle
A bundle to catch API webhook from different mail service
Stars: ✭ 36 (+125%)
Mutual labels:  mailgun, sendgrid
Magento2 Gmail Smtp App
Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers
Stars: ✭ 281 (+1656.25%)
Mutual labels:  mailgun, sendgrid
Mailer
A light-weight, modular, message representation and mail delivery framework for Python.
Stars: ✭ 225 (+1306.25%)
Mutual labels:  mailgun, sendgrid
Fluentemail
All in one email sender for .NET. Supports popular senders (SendGrid, MailGun, etc) and Razor templates.
Stars: ✭ 1,888 (+11700%)
Mutual labels:  mailgun, sendgrid
Goeat Api
Rest API for a food delivery application - Built with Express, Postgres, Redis, MongoDB and Nodemailer
Stars: ✭ 36 (+125%)
Mutual labels:  mailgun
Suet
An analytics dashboard and reporting tool for Mailgun and Amazon SES transactional emails.
Stars: ✭ 114 (+612.5%)
Mutual labels:  mailgun
Laravel Mailguneu
Allow customising the Mailgun server URL to use EU servers.
Stars: ✭ 13 (-18.75%)
Mutual labels:  mailgun
Example Airflow Dags
Example DAGs using hooks and operators from Airflow Plugins
Stars: ✭ 243 (+1418.75%)
Mutual labels:  mailgun
Mailgun Js Boland
A simple Node.js helper module for Mailgun API.
Stars: ✭ 895 (+5493.75%)
Mutual labels:  mailgun

Mailer

This project aims to provide a common api for popular email providers. It currently supports

  • Mailgun
  • Sendgrid

I also plan to add a wrapper for SMTP

Installation

Add this to your application's shard.yml:

dependencies:
  mailer:
    github: crisward/mailer

Usage

require "mailer"

Mailer.config(provider: Mailer::Mailgun.new(key: ENV["MAILGUN_KEY"], domain: ENV["MAILGUN_DOMAIN"]))
email = Mailer::Message.new
email.to("[email protected]","their_name")
email.from = "[email protected]"
email.subject = "Hello"
email.text = "Some plain text messaeg"
email.html = "<p>Some html message <img src='cid:logo.jpg'></p>"
email.attachment = Mailer::Attachment.new(filename: "test.pdf" , path: "./spec/test.pdf")
email.inline = Mailer::Attachment.new(filename: "logo.jpg" , path: "./spec/test.png")
email.send

To use sendgrid, swap the first line to

Mailer.config(provider: Mailer::Sendgrid.new(key: "your sendgrid api key"))

Testing Your App

While testing your app, you probably won't want to send real emails. You can use the built in Mock provider for this.

# eg for kemal
if ENV["KEMAL_ENV"]? != "test"
  Mailer.config(provider: Mailer::Mailgun.new(key: ENV["MAILGUN_KEY"], domain: ENV["MAILGUN_DOMAIN"]))
else
  Mailer.config(provider:Mailer::Mock.new())
end

Development

Running tests

# mock
crystal spec

#mailgun
MAILGUN_KEY="your-api-key" MAILGUN_DOMAIN="mailgun-domain" EMAIL="[email protected]" crystal spec

#sendgrid
SENDGRID_KEY="your-api-key" EMAIL="[email protected]" crystal spec

Todo

This library isn't full baked. It works, but there are some thing which need adding

  • Error Handling
  • Logging
  • Adding SMTP option

Contributing

  1. Fork it ( https://github.com/crisward/mailer/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].