How about using the render_to_string method? I believe you want to dynamically generate the view content. Reading up the view template by opening up the file would not run any Ruby code in it.
class MailgunMails < ActionMailer::Base
def send_complex_message
data = Multimap.new
data[:from] = "Excited User <postmasters@#{@@domain}>"
data[:to] = "alice@example.com"
data[:subject] = "Hello"
html_output = render_to_string template: "mailgun_mails/send_complex_message"
data[:html] = html_output.to_str
response = RestClient.post "https://api:#{@@private_key}"\
"@api.mailgun.net/v2/#{@@domain}/messages", data
response = JSON.parse(response)
end
end