support/ruby/collins-notify/lib/collins_notify/adapter/email.rb
def notify! message_obj = OpenStruct.new, to = nil
      sender_address = get_sender_address message_obj
      recipient_address = get_recipient_address message_obj, to
      subject = get_subject message_obj
      message = get_message_body(binding)
      subject = message.subject # Subject may change based on message template
      (raise CollinsNotify::CollinsNotifyException.new("No subject specified")) if subject.nil?
      logger.info "From: #{sender_address}, To: #{recipient_address}, Subject: #{subject}"
      logger.trace "Message body:\n#{message}"
      begin
        mail = Mail.new message
        logger.debug "Attempting to deliver email message"
        if config.test? then
          logger.info "Not delivering email, running in test mode"
        else
          logger.info "Delivering email message"
          mail.deliver!
        end
        true
      rescue Exception => e
        logger.fatal "Error sending email - #{e}"
        false
      end
    end
# Available in template binding
#   sender_address - Address of sender
#   recipient_address - Resolved address of recipient
#   subject - Mail subject
#   message_obj - Depends on call
Available in template binding
sender_address - Address of sender
recipient_address - Resolved address of recipient
subject - Mail subject
message_obj - Depends on call
Available in template binding sender_address - Address of sender recipient_address - Resolved address of recipient subject - Mail subject message_obj - Depends on call
def notify! message_obj = OpenStruct.new, to = nil
      sender_address = get_sender_address message_obj
      recipient_address = get_recipient_address message_obj, to
      subject = get_subject message_obj
      message = get_message_body(binding)
      subject = message.subject 
      (raise CollinsNotify::CollinsNotifyException.new("No subject specified")) if subject.nil?
      logger.info "From: #{sender_address}, To: #{recipient_address}, Subject: #{subject}"
      logger.trace "Message body:\n#{message}"
      begin
        mail = Mail.new message
        logger.debug "Attempting to deliver email message"
        if config.test? then
          logger.info "Not delivering email, running in test mode"
        else
          logger.info "Delivering email message"
          mail.deliver!
        end
        true
      rescue Exception => e
        logger.fatal "Error sending email - #{e}"
        false
      end
    end
def notify! message_obj = OpenStruct . new , to = nil sender_address = get_sender_address message_obj recipient_address = get_recipient_address message_obj , to subject = get_subject message_obj message = get_message_body ( binding ) subject = message . subject ( raise CollinsNotify :: CollinsNotifyException . new ( "No subject specified" ) ) if subject . nil? logger . info "From: #{sender_address}, To: #{recipient_address}, Subject: #{subject}" logger . trace "Message body:\n#{message}" begin mail = Mail . new message logger . debug "Attempting to deliver email message" if config . test? then logger . info "Not delivering email, running in test mode" else logger . info "Delivering email message" mail . deliver! end true rescue Exception => e logger . fatal "Error sending email - #{e}" false end end
Available in template binding
sender_address - Address of sender
recipient_address - Resolved address of recipient
subject - Mail subject
message_obj - Depends on call
Available in template binding sender_address - Address of sender recipient_address - Resolved address of recipient subject - Mail subject message_obj - Depends on call
# Subject may change based on message template
message_obj
new
to