Skip to content

Commit

Permalink
Merge pull request #65 from thepriefy/patch-2
Browse files Browse the repository at this point in the history
Fix "Complexity" issue in examples/example.py
  • Loading branch information
thinkingserious committed Oct 22, 2018
2 parents a7a0e80 + d02fe16 commit 1d22d35
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions examples/example.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Python 2/3 compatible codebase
from __future__ import absolute_import, division, print_function
from smtpapi import SMTPAPIHeader

import time

Expand All @@ -8,28 +9,27 @@
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from smtpapi import SMTPAPIHeader

from smtpapi import SMTPAPIHeader
header = SMTPAPIHeader()

# [To](http://sendgrid.com/docs/API_Reference/SMTP_API/index.html)
#header.add_to('test@example.com')
# header.add_to('test@example.com')
header.set_tos(['test1@example.com', 'test2@example.com'])

# [Substitutions](http://sendgrid.com/docs/API_Reference/SMTP_API/substitution_tags.html)
#header.add_substitution('key', 'value')
# header.add_substitution('key', 'value')
header.set_substitutions({'key': ['value1', 'value2']})

# [Unique Arguments](http://sendgrid.com/docs/API_Reference/SMTP_API/unique_arguments.html)
#header.add_unique_arg('key', 'value')
# header.add_unique_arg('key', 'value')
header.set_unique_args({'key':'value'})

# [Categories](http://sendgrid.com/docs/API_Reference/SMTP_API/categories.html)
#header.add_category('category')
# header.add_category('category')
header.set_categories(['category1', 'category2'])

# [Sections](http://sendgrid.com/docs/API_Reference/SMTP_API/section_tags.html)
#header.add_section('key', 'section')
header.set_sections({'key1':'section1', 'key2':'section2'})
# header.add_section('key', 'section')
header.set_sections({'key1': 'section1', 'key2': 'section2'})

# [Filters](http://sendgrid.com/docs/API_Reference/SMTP_API/apps.html)
header.add_filter('filter', 'setting', 'value')
Expand All @@ -41,8 +41,8 @@
header.set_ip_pool("testPool")

# [Scheduling Parameters](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html)
#header.add_send_each_at(unix_timestamp) # must be a unix timestamp
#header.set_send_each_at([]) # must be a unix timestamp
header.set_send_at(int(time.time())) # must be a unix timestamp
# header.add_send_each_at(unix_timestamp) # must be a unix timestamp
# header.set_send_each_at([]) # must be a unix timestamp
header.set_send_at(int(time.time())) # must be a unix timestamp

print(header.json_string())
print(header.json_string())

0 comments on commit 1d22d35

Please sign in to comment.