comm/emails.rb
# more "from" emails can be added on Postmark
more "from" emails can be added on Postmark
more " from " emails can be added on Postmark
def send_email(to, subj, html_body, opts = {})
  res = 'unset'
  if EMAILS_ON
    res = $postmark_client.deliver(
      from: opts[:from] || EMAILS_FROM,
      to: to,
      subject: subj,
      html_body: html_body,
      track_opens: true
    )
  else 
    puts "Skipping email subject: #{subj} because !EMAILS_ON".red    
  end
  $emails_sent.add(to: to, subj: subj, html_body: html_body, opts: opts, res: res)
rescue => e
  puts e.to_s.red
  log_e(e)
  false
end
def send_email ( to , subj , html_body , opts = { } ) res = 'unset' if EMAILS_ON res = $postmark_client . deliver ( from : opts [ :from ] || EMAILS_FROM , to : to , subject : subj , html_body : html_body , track_opens : true ) else puts "Skipping email subject: #{subj} because !EMAILS_ON" . red end $emails_sent . add ( to : to , subj : subj , html_body : html_body , opts : opts , res : res ) rescue => e puts e . to_s . red log_e ( e ) false end
more "from" emails can be added on Postmark
more " from " emails can be added on Postmark
to
subj
html_body
opts