dolist config
This commit is contained in:
parent
cb6dd3dce9
commit
aa0ef955d5
3 changed files with 37 additions and 0 deletions
|
@ -112,3 +112,9 @@ MATOMO_IFRAME_URL="https://matomo.example.org/index.php?module=CoreAdminHome&act
|
|||
# ACTIVE_STORAGE_FILE_SIZE_THRESHOLD_BEFORE_CUSTOM_UPLOAD=4294967296
|
||||
# a custom script handling upload of big file
|
||||
# ACTIVE_STORAGE_BIG_FILE_UPLOADER_WITH_ENCRYPTION_PATH='/usr/local/bin/swift'
|
||||
|
||||
# SMTP Provider: Dolist
|
||||
# DOLIST_USERNAME=""
|
||||
# DOLIST_PASSWORD=""
|
||||
# DOLIST_ACCOUNT_ID=""
|
||||
# DOLIST_NO_REPLY_EMAIL=""
|
||||
|
|
27
config/initializers/dolist.rb
Normal file
27
config/initializers/dolist.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
ActiveSupport.on_load(:action_mailer) do
|
||||
module Dolist
|
||||
class SMTP < ::Mail::SMTP
|
||||
def deliver!(mail)
|
||||
mail.from(ENV['DOLIST_NO_REPLY_EMAIL'])
|
||||
mail.sender(ENV['DOLIST_NO_REPLY_EMAIL'])
|
||||
mail['X-ACCOUNT-ID'] = Rails.application.secrets.dolist[:account_id]
|
||||
|
||||
mail['X-Dolist-Message-Name'] = mail.subject # for tracking in Dolist UI
|
||||
mail['X-Dolist-Sending-Type'] = 'TransactionalService' # send even if the target is not active
|
||||
|
||||
super(mail)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ActionMailer::Base.add_delivery_method :dolist, Dolist::SMTP
|
||||
|
||||
ActionMailer::Base.dolist_settings = {
|
||||
user_name: Rails.application.secrets.dolist[:username],
|
||||
password: Rails.application.secrets.dolist[:password],
|
||||
address: 'smtp.dolist.net',
|
||||
port: 587,
|
||||
authentication: 'plain',
|
||||
enable_starttls_auto: true
|
||||
}
|
||||
end
|
|
@ -35,6 +35,10 @@ defaults: &defaults
|
|||
mailjet:
|
||||
api_key: <%= ENV['MAILJET_API_KEY'] %>
|
||||
secret_key: <%= ENV['MAILJET_SECRET_KEY'] %>
|
||||
dolist:
|
||||
username: <%= ENV['DOLIST_USERNAME'] %>
|
||||
password: <%= ENV['DOLIST_PASSWORD'] %>
|
||||
account_id: <%= ENV['DOLIST_ACCOUNT_ID'] %>
|
||||
api_entreprise:
|
||||
key: <%= ENV['API_ENTREPRISE_KEY'] %>
|
||||
pipedrive:
|
||||
|
|
Loading…
Reference in a new issue