@@ -122,26 +122,62 @@ def from_content( # rubocop:disable Metrics/ParameterLists
122
122
# defined in the Mailtrap dashboard and referenced by the template_uuid.
123
123
# Template variables can be passed to customize the template content.
124
124
# @example
125
- # mail = Mailtrap::Mail.batch_from_template (
125
+ # mail = Mailtrap::Mail.batch_base_from_template (
126
126
# from: { email: '[email protected] ', name: 'Mailtrap Test' },
127
127
# template_uuid: '2f45b0aa-bbed-432f-95e4-e145e1965ba2',
128
128
# template_variables: {
129
129
# 'user_name' => 'John Doe'
130
130
# }
131
131
# )
132
- def batch_from_template ( **args )
133
- from_template ( **args . except ( :to , :cc , :bcc ) )
132
+ def batch_base_from_template ( # rubocop:disable Metrics/ParameterLists
133
+ from : nil ,
134
+ reply_to : nil ,
135
+ attachments : [ ] ,
136
+ headers : { } ,
137
+ custom_variables : { } ,
138
+ template_uuid : nil ,
139
+ template_variables : { }
140
+ )
141
+ Mailtrap ::Mail ::Base . new (
142
+ from :,
143
+ reply_to :,
144
+ attachments :,
145
+ headers :,
146
+ custom_variables :,
147
+ template_uuid :,
148
+ template_variables :
149
+ )
134
150
end
135
151
136
152
# Builds a mail object with content including subject, text, html, and category.
137
153
# @example
138
- # mail = Mailtrap::Mail.batch_from_content (
154
+ # mail = Mailtrap::Mail.batch_base_from_content (
139
155
# from: { email: '[email protected] ', name: 'Mailtrap Test' },
140
156
# subject: 'You are awesome!',
141
157
# text: 'Congrats for sending test email with Mailtrap!'
142
158
# )
143
- def batch_from_content ( **args )
144
- from_content ( **args . except ( :to , :cc , :bcc ) )
159
+ def batch_base_from_content ( # rubocop:disable Metrics/ParameterLists
160
+ from : nil ,
161
+ reply_to : nil ,
162
+ attachments : [ ] ,
163
+ headers : { } ,
164
+ custom_variables : { } ,
165
+ subject : nil ,
166
+ text : nil ,
167
+ html : nil ,
168
+ category : nil
169
+ )
170
+ Mailtrap ::Mail ::Base . new (
171
+ from :,
172
+ reply_to :,
173
+ attachments :,
174
+ headers :,
175
+ custom_variables :,
176
+ subject :,
177
+ text :,
178
+ html :,
179
+ category :
180
+ )
145
181
end
146
182
147
183
# Builds a mail object from Mail::Message
0 commit comments