forked from sendgrid/sendgrid-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
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
4 changed files
with
36 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
Contributors: | ||
|
||
<!-- ## | ||
## THIS IS HOW I WANNA USE IT. | ||
# sg = sendgrid::Client.new("Myuser", "Mykey") | ||
# m = sendgrid::Mail.new() | ||
# m.to("[email protected]") | ||
# sg.send(m) | ||
## OR | ||
# m = sendgrid::Mail.new(:to => "[email protected]", :from => "[email protected]") | ||
# sg.send(m) | ||
# | ||
## | ||
## | ||
--> | ||
|
||
|
||
# Sendgrid::Ruby | ||
|
||
TODO: Write a gem description | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
require "faraday" | ||
|
||
module SendGrid | ||
class Client | ||
|
||
|
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 |
---|---|---|
|
@@ -3,51 +3,51 @@ | |
module SendGrid | ||
class Mail | ||
|
||
def initialize() | ||
@endpoint = "/api/mail.send.json?" | ||
def initialize(to) | ||
@endpoint = "/api/mail.send.json" | ||
end | ||
|
||
attr_reader :to_email, | ||
attr_accessor :endpoint, :to, :from, :subject, :text | ||
|
||
def add_to(to_email) | ||
#add stuff | ||
@to = to_email | ||
end | ||
|
||
def add_tos(to_emails = {}) | ||
#add stuff | ||
@tos = Array.new(10) { iii } | ||
end | ||
|
||
def add_to_name(name) | ||
def add_to_name(to_name) | ||
#add stuff | ||
end | ||
|
||
def add_to_names(names = {}) | ||
def add_to_names(to_names = {}) | ||
#add stuff | ||
end | ||
|
||
def set_from(from_email) | ||
#add stuff | ||
@from = from_email | ||
end | ||
|
||
def set_from_email(from_name) | ||
#add stuff | ||
end | ||
|
||
def set_subject(subject) | ||
#add stuff | ||
@subject = subject | ||
end | ||
|
||
def set_text(text, format) | ||
#add stuff | ||
def set_text(text) | ||
@text = text | ||
end | ||
|
||
def set_html(html, something = {}, inject(Array.new) { |arr, a| arr.push(*a) }) | ||
def set_html(html) | ||
#add stuff | ||
end | ||
|
||
def set_x_smtpapi(json{}) | ||
# def set_x_smtpapi(json{}) | ||
|
||
end | ||
# end | ||
|
||
def add_bcc(bcc) | ||
#add stuff | ||
|
@@ -79,18 +79,3 @@ def add_headers(headers = {}) | |
|
||
end | ||
end | ||
|
||
|
||
|
||
|
||
## | ||
## THIS IS HOW I WANNA USE IT. | ||
# sg = sendgrid.Client.new("Myuser", "Mykey") | ||
# m = sendgrid.Mail.new() | ||
# m.add_to("[email protected]") | ||
# sg.send(m) | ||
|
||
## OR | ||
|
||
# m = sendgrid.Mail.new(:to => "[email protected]", :from => "[email protected]") | ||
# sg.send(m) |
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ Gem::Specification.new do |gem| | |
gem.email = '[email protected]' | ||
gem.homepage = 'http://github.com/sendgrid/sendgrid-ruby' | ||
|
||
gem.add_development_dependency "faraday" | ||
gem.add_development_dependency "rake" | ||
gem.add_development_dependency "rspec" | ||
gem.add_development_dependency "rspec-nc" | ||
|