File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,9 +173,10 @@ mail(delivery_method: :mailtrap_bulk)
173173Refer to the [ ` examples ` ] ( examples ) folder for more examples:
174174
175175Email API:
176- - Full email sending – [ ` full.rb ` ] ( examples/full.rb )
177176
177+ - Full email sending – [ ` full.rb ` ] ( examples/full.rb )
178178- Batch sending – [ ` batch.rb ` ] ( examples/batch.rb )
179+ - Sending domains API – [ ` sending_domains_api.rb ` ] ( examples/sending_domains_api.rb )
179180
180181Email Sandbox (Testing):
181182
Original file line number Diff line number Diff line change 1+ require 'mailtrap'
2+
3+ account_id = 3229
4+ client = Mailtrap ::Client . new ( api_key : 'your-api-key' )
5+ sending_domains = Mailtrap ::InboxesAPI . new ( account_id , client )
6+
7+ # Create new Sending Domain
8+ sending_domain = sending_domains . create ( domain_name : 'example.com' )
9+ # => #<struct Mailtrap::SendingDomain id=1, domain_name="example.com">
10+
11+ # Get all Sending Domains
12+ sending_domains . list
13+ # => [#<struct Mailtrap::SendingDomain id=1, domain_name="example.com">]
14+
15+ # Update Sending Domain
16+ sending_domains . update ( sending_domain . id , domain_name : 'proper.com' )
17+ # => #<struct Mailtrap::SendingDomain id=1, domain_name="proper.com">
18+
19+ # Get sending domain
20+ sending_domain = sending_domains . get ( sending_domain . id )
21+ # => #<struct Mailtrap::SendingDomain id=1, domain_name="proper.com">
22+
23+ # Send setup email
24+ sending_domains . clean ( sending_domain . id , 'jonathan@mail.com' )
25+ # => nil
26+
27+ # Delete sending domain
28+ sending_domains . delete ( sending_domain . id )
29+ # => nil
You can’t perform that action at this time.
0 commit comments