spree
spree copied to clipboard
How to config smtp for different Spree store
Two store use different domain and smtp server. How to config it?
Save smtp setting in store config, use Rails ActionMailer method option delivery_method_options.
class UserMailer < ApplicationMailer
def welcome_email
@user = params[:user]
@url = user_url(@user)
delivery_options = { user_name: params[:company].smtp_user,
password: params[:company].smtp_password,
address: params[:company].smtp_host }
mail(to: @user.email,
subject: "Please see the Terms and Conditions attached",
delivery_method_options: delivery_options)
end
end
hey @chuckaiyu , I have tried to upgrade spree mail setting gem and made it store specific SMTP configuration setting.
Hope this will helpful for you, Check this: https://github.com/rahul2103/spree_mail_settings
Thanks.
@rahul2103 Wow, Thanks!