Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

action_mailer-logged_smtp_delivery

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

action_mailer-logged_smtp_delivery

  • 2.4.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Logged SMTP Delivery

require 'action_mailer/logged_smtp_delivery'
config.action_mailer.logged_smtp_settings = {
  ... normal smtp settings ...,
  logger: Logger.new, # progress info
  mail_file_logger: FileLogger.new # write encoded mails for storage, must return path they were stored in
}


Detailed log stream with message id prefix. Example:

<4e2b38d772949_b81ac212@localhost> stored at example/log/mails/outbound/2011-07-23/7_13462_2.eml
<4e2b38d772949_b81ac212@localhost> X-Delivery-Context: [users/1/welcome]
<4e2b38d772949_b81ac212@localhost> sender: support@support.localhost
<4e2b38d772949_b81ac212@localhost> destinations: support@system.example.com
<4e2b38d772949_b81ac212@localhost> done #<Net::SMTP::Response:0x10bbee680 @string="250 2.0.0 Ok: queued as 87BF716D7901\n", @status="250">

Logs an identification header to quickly locate logs for a specific email/entity

config.action_mailer.logged_smtp_settings[:log_header] = 'X-Delivery-Context'

class UsersMailer < ActionMailer::Base
  
  def welcome(user)
    headers['X-Delivery-Context'] = "users/#{user.id}/welcome"
    
    # ...
  end
end


UsersMailer.welcome(user).deliver
# ActionMailer::Base.logger -> 
# <4e2b38d772949_b81ac212@localhost> X-Delivery-Context: [users/1/welcome]

Doesn't render BCC recipients

License: Apache V2

FAQs

Package last updated on 19 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc