lib/snails/mailer.rb in snails-0.2.1 vs lib/snails/mailer.rb in snails-0.2.2
- old
+ new
@@ -93,11 +93,11 @@
def logger
@logger ||= @logfile ? Logger.new(@logfile) : Snails.logger
end
- def send_email(from: nil, to:, subject:, body: nil, template: nil, html_body: nil, html_template: nil)
+ def send_email(from: nil, to:, subject:, body: nil, template: nil, html_body: nil, html_template: nil, message_id: nil, return_path: nil, list_unsubscribe: nil)
raise "No recipient given for mail: #{subject}!" if to.blank?
message = {
to: to,
from: from || @from_email,
@@ -109,9 +109,13 @@
end
if html_body or html_template
message[:html_body] = html_template ? render(html_template) : html_body
end
+
+ message[:message_id] = message_id if message_id
+ message[:return_path] = return_path if return_path
+ message[:list_unsubscribe] = list_unsubscribe if list_unsubscribe
logger.info "[#{to}] Delivering: #{subject}"
debug = @debug.nil? ? !Snails.env.production? : @debug # if debug isn't set, determine based on env
resp, email = Tuktuk.deliver(message, debug: debug)
\ No newline at end of file