Class: WunderlistMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/wunderlist_mailer.rb

Overview

make sure to require mail gem

Instance Method Summary collapse

Instance Method Details

#email_task(task, options) ⇒ Object

Email the task to Wunderlist and set its importance



6
7
8
9
10
11
12
13
14
# File 'app/mailers/wunderlist_mailer.rb', line 6

def email_task(task, options)
	mail_options = {:to => "[email protected]"}
	mail_options[:subject] = options.has_key?(:wunderlist_list)  ? options[:wunderlist_list] : ''
	mail_options[:from] = options[:wunderlist_email]
	@task = task
	@task.name = @task.asset_type.empty? ? @task.name : "#{@task.name} for #{@task.asset.name} (#{@task.asset_type.downcase})"
	@important_marker = ['due_asap', 'due_today'].include?(@task.bucket) ? '*' : ''
	mail(mail_options)
end