mandrill-api 1.0.22 → 1.0.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/mandrill/api.rb +61 -4
  2. metadata +3 -3
data/lib/mandrill/api.rb CHANGED
@@ -10,19 +10,31 @@ module Mandrill
10
10
 
11
11
  # Add a new template
12
12
  # @param [String] name the name for the new template - must be unique
13
+ # @param [String] from_email a default sending address for emails sent using this template
14
+ # @param [String] from_name a default from name to be used
15
+ # @param [String] subject a default subject line to be used
13
16
  # @param [String] code the HTML code for the template with mc:edit attributes for the editable elements
17
+ # @param [String] text a default text part to be used when sending with this template
14
18
  # @param [Boolean] publish set to false to add a draft template without publishing
15
19
  # @return [Hash] the information saved about the new template
16
20
  # - [String] slug the immutable unique code name of the template
17
21
  # - [String] name the name of the template
18
22
  # - [String] code the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version
23
+ # - [String] subject the subject line of the template, if provided - draft version
24
+ # - [String] from_email the default sender address for the template, if provided - draft version
25
+ # - [String] from_name the default sender from name for the template, if provided - draft version
26
+ # - [String] text the default text part of messages sent with the template, if provided - draft version
19
27
  # - [String] publish_name the same as the template name - kept as a separate field for backwards compatibility
20
28
  # - [String] publish_code the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published
29
+ # - [String] publish_subject the subject line of the template, if provided
30
+ # - [String] publish_from_email the default sender address for the template, if provided
31
+ # - [String] publish_from_name the default sender from name for the template, if provided
32
+ # - [String] publish_text the default text part of messages sent with the template, if provided
21
33
  # - [String] published_at the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published
22
34
  # - [String] created_at the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format
23
35
  # - [String] updated_at the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format
24
- def add(name, code, publish=true)
25
- _params = {:name => name, :code => code, :publish => publish}
36
+ def add(name, from_email=nil, from_name=nil, subject=nil, code=nil, text=nil, publish=true)
37
+ _params = {:name => name, :from_email => from_email, :from_name => from_name, :subject => subject, :code => code, :text => text, :publish => publish}
26
38
  return @master.call 'templates/add', _params
27
39
  end
28
40
 
@@ -32,8 +44,16 @@ module Mandrill
32
44
  # - [String] slug the immutable unique code name of the template
33
45
  # - [String] name the name of the template
34
46
  # - [String] code the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version
47
+ # - [String] subject the subject line of the template, if provided - draft version
48
+ # - [String] from_email the default sender address for the template, if provided - draft version
49
+ # - [String] from_name the default sender from name for the template, if provided - draft version
50
+ # - [String] text the default text part of messages sent with the template, if provided - draft version
35
51
  # - [String] publish_name the same as the template name - kept as a separate field for backwards compatibility
36
52
  # - [String] publish_code the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published
53
+ # - [String] publish_subject the subject line of the template, if provided
54
+ # - [String] publish_from_email the default sender address for the template, if provided
55
+ # - [String] publish_from_name the default sender from name for the template, if provided
56
+ # - [String] publish_text the default text part of messages sent with the template, if provided
37
57
  # - [String] published_at the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published
38
58
  # - [String] created_at the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format
39
59
  # - [String] updated_at the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format
@@ -44,19 +64,31 @@ module Mandrill
44
64
 
45
65
  # Update the code for an existing template
46
66
  # @param [String] name the immutable name of an existing template
67
+ # @param [String] from_email the new default sending address
68
+ # @param [String] from_name the new default from name
69
+ # @param [String] subject the new default subject line
47
70
  # @param [String] code the new code for the template
71
+ # @param [String] text the new default text part to be used
48
72
  # @param [Boolean] publish set to false to update the draft version of the template without publishing
49
73
  # @return [Hash] the template that was updated
50
74
  # - [String] slug the immutable unique code name of the template
51
75
  # - [String] name the name of the template
52
76
  # - [String] code the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version
77
+ # - [String] subject the subject line of the template, if provided - draft version
78
+ # - [String] from_email the default sender address for the template, if provided - draft version
79
+ # - [String] from_name the default sender from name for the template, if provided - draft version
80
+ # - [String] text the default text part of messages sent with the template, if provided - draft version
53
81
  # - [String] publish_name the same as the template name - kept as a separate field for backwards compatibility
54
82
  # - [String] publish_code the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published
83
+ # - [String] publish_subject the subject line of the template, if provided
84
+ # - [String] publish_from_email the default sender address for the template, if provided
85
+ # - [String] publish_from_name the default sender from name for the template, if provided
86
+ # - [String] publish_text the default text part of messages sent with the template, if provided
55
87
  # - [String] published_at the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published
56
88
  # - [String] created_at the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format
57
89
  # - [String] updated_at the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format
58
- def update(name, code, publish=true)
59
- _params = {:name => name, :code => code, :publish => publish}
90
+ def update(name, from_email=nil, from_name=nil, subject=nil, code=nil, text=nil, publish=true)
91
+ _params = {:name => name, :from_email => from_email, :from_name => from_name, :subject => subject, :code => code, :text => text, :publish => publish}
60
92
  return @master.call 'templates/update', _params
61
93
  end
62
94
 
@@ -66,8 +98,16 @@ module Mandrill
66
98
  # - [String] slug the immutable unique code name of the template
67
99
  # - [String] name the name of the template
68
100
  # - [String] code the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version
101
+ # - [String] subject the subject line of the template, if provided - draft version
102
+ # - [String] from_email the default sender address for the template, if provided - draft version
103
+ # - [String] from_name the default sender from name for the template, if provided - draft version
104
+ # - [String] text the default text part of messages sent with the template, if provided - draft version
69
105
  # - [String] publish_name the same as the template name - kept as a separate field for backwards compatibility
70
106
  # - [String] publish_code the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published
107
+ # - [String] publish_subject the subject line of the template, if provided
108
+ # - [String] publish_from_email the default sender address for the template, if provided
109
+ # - [String] publish_from_name the default sender from name for the template, if provided
110
+ # - [String] publish_text the default text part of messages sent with the template, if provided
71
111
  # - [String] published_at the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published
72
112
  # - [String] created_at the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format
73
113
  # - [String] updated_at the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format
@@ -82,8 +122,16 @@ module Mandrill
82
122
  # - [String] slug the immutable unique code name of the template
83
123
  # - [String] name the name of the template
84
124
  # - [String] code the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version
125
+ # - [String] subject the subject line of the template, if provided - draft version
126
+ # - [String] from_email the default sender address for the template, if provided - draft version
127
+ # - [String] from_name the default sender from name for the template, if provided - draft version
128
+ # - [String] text the default text part of messages sent with the template, if provided - draft version
85
129
  # - [String] publish_name the same as the template name - kept as a separate field for backwards compatibility
86
130
  # - [String] publish_code the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published
131
+ # - [String] publish_subject the subject line of the template, if provided
132
+ # - [String] publish_from_email the default sender address for the template, if provided
133
+ # - [String] publish_from_name the default sender from name for the template, if provided
134
+ # - [String] publish_text the default text part of messages sent with the template, if provided
87
135
  # - [String] published_at the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published
88
136
  # - [String] created_at the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format
89
137
  # - [String] updated_at the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format
@@ -98,8 +146,16 @@ module Mandrill
98
146
  # - [String] slug the immutable unique code name of the template
99
147
  # - [String] name the name of the template
100
148
  # - [String] code the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version
149
+ # - [String] subject the subject line of the template, if provided - draft version
150
+ # - [String] from_email the default sender address for the template, if provided - draft version
151
+ # - [String] from_name the default sender from name for the template, if provided - draft version
152
+ # - [String] text the default text part of messages sent with the template, if provided - draft version
101
153
  # - [String] publish_name the same as the template name - kept as a separate field for backwards compatibility
102
154
  # - [String] publish_code the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published
155
+ # - [String] publish_subject the subject line of the template, if provided
156
+ # - [String] publish_from_email the default sender address for the template, if provided
157
+ # - [String] publish_from_name the default sender from name for the template, if provided
158
+ # - [String] publish_text the default text part of messages sent with the template, if provided
103
159
  # - [String] published_at the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published
104
160
  # - [String] created_at the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format
105
161
  # - [String] updated_at the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format
@@ -582,6 +638,7 @@ module Mandrill
582
638
  # - [String] name the name of the mc:edit editable region to inject into
583
639
  # - [String] content the content to inject
584
640
  # @param [Hash] message the other information on the message to send - same as /messages/send, but without the html content
641
+ # - [String] html optional full HTML content to be sent if not in template
585
642
  # - [String] text optional full text content to be sent
586
643
  # - [String] subject the message subject
587
644
  # - [String] from_email the sender email address.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mandrill-api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 22
10
- version: 1.0.22
9
+ - 23
10
+ version: 1.0.23
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mandrill Devs