Main Avalanche Network server application. Built with Ruby on Rails.

user_mailer.rb 1.5KB

    class UserMailer < ActionMailer::Base include Roadie::Rails::Automatic default from: "mission_control@avalanche.network" def signup_message(user) I18n.with_locale(user.language) do config = Info.first mail :to => user.email, :subject => (t 'sign_up_email.email_subject'), :from => 'mission_control@avalanche.network', :from_name => 'Avalanche Network' end end def contact_message(contact_message, to_address) @msg = contact_message mail :to => to_address, :subject => @msg.title, :from => @msg.user == nil ? @msg.email : @msg.user.email, :from_name => @msg.user != nil ? @msg.user.full_name : @msg.email, :body => @msg.content end def newsletter_subscription(subscription) config = Info.first mail :to => subscription.email, :subject => (t 'newsletter_subscription.subject'), :from => config.contact_email, :from_name => config.website_name, :body => (t 'newsletter_subscription.message') end def invite_message(user, from, content) @user = user @from = from @token = user.raw_invitation_token invitation_link = accept_user_invitation_url(:invitation_token => @token) I18n.with_locale(from.language) do mail(:from => from.email, :bcc => from.email, :to => @user.email, :subject => (t 'invite_email.email_subject')) end end end