Created
          November 3, 2011 09:43 
        
      - 
      
- 
        Save ciaranarcher/1336149 to your computer and use it in GitHub Desktop. 
    Email Helper 
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Helper class for sending emails. | |
| # | |
| # @author Ciaran Archer | |
| class EmailHelper | |
| # @author Ciaran Archer | |
| # @param [String] to | |
| # @param [String] subject | |
| # @param [String] body | |
| # @param [String] from | |
| # @return [nil] | |
| # @todo we can add whatever logging / headers etc. we wish here | |
| def send_email(to, subject, body, from="[email protected]") | |
| Mail.new( | |
| to: to, | |
| from: from, | |
| subject: subject, | |
| body: body, | |
| content_type: 'text/html; charset=UTF-8' | |
| ).deliver! | |
| end | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment