lib/monkey_mail/clients/mailgun_client.rb in monkey-mail-0.1.0 vs lib/monkey_mail/clients/mailgun_client.rb in monkey-mail-0.1.1

- old
+ new

@@ -9,14 +9,15 @@ def initialize(api_key, domain) @api_key = api_key @domain = domain end - def send_template(template_name:, subject:, from_email:, from_name:, to:, vars:) + def send_template(template_name:, subject:, from_email:, from_name:, to:, vars:, attachment: nil) payload = { :from => "#{from_name} <#{from_email}>", :to => to.join(', '), :subject => subject, :template => template_name, + :attachment => attachment, 't:variables' => vars.to_json } RestClient::Request.execute(method: :post, url: messages_url, payload: payload)