Merge pull request #21 from exstake/feature/password-reset-mailing
password reset mailing
This commit is contained in:
14
.env
14
.env
@@ -0,0 +1,14 @@
|
||||
MAILTRAP_USERNAME=58ac7f54c30546
|
||||
MAILTRAP_PASSWORD=c3f04d22023e55
|
||||
MAILTRAP_ADDRESS=smtp.mailtrap.io
|
||||
MAILTRAP_DOMAIN=smtp.mailtrap.io
|
||||
MAILTRAP_PORT=2525
|
||||
MAILER_DEFAULT_URL_HOST=localhost:5000
|
||||
|
||||
|
||||
# production
|
||||
# MAILGUN_DOMAIN=
|
||||
# MAILGUN_SMTP_LOGIN=
|
||||
# MAILGUN_SMTP_PASSWORD=
|
||||
# MAILGUN_SMTP_PORT=
|
||||
# MAILGUN_SMTP_SERVER=
|
||||
@@ -1,24 +1,26 @@
|
||||
<h2><%= t('.change_your_password') %></h2>
|
||||
<h2 class="self-center mb-2 text-xl font-light text-gray-800 sm:text-2xl dark:text-white text-center">
|
||||
<%= t('.change_your_password') %>
|
||||
</h2>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
||||
<%= render "devise/shared/error_messages", resource: resource %>
|
||||
<%= f.hidden_field :reset_password_token %>
|
||||
|
||||
<div class="field">
|
||||
<div class="field my-3">
|
||||
<%= f.label :password, t('.new_password') %><br />
|
||||
<% if @minimum_password_length %>
|
||||
<em><%= t('devise.shared.minimum_password_length', count: @minimum_password_length) %></em><br />
|
||||
<% end %>
|
||||
<%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
|
||||
<%= f.password_field :password, autofocus: true, autocomplete: "new-password", class: TailwindHelper.input_classes %>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="field my-3">
|
||||
<%= f.label :password_confirmation, t('.confirm_new_password') %><br />
|
||||
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
|
||||
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: TailwindHelper.input_classes %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit t('.change_my_password') %>
|
||||
<div class="actions my-3">
|
||||
<%= f.submit t('.change_my_password'), class: TailwindHelper.primary_button_classes %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
<h2><%= t('.forgot_your_password') %></h2>
|
||||
<h2 class="self-center mb-2 text-xl font-light text-gray-800 sm:text-2xl dark:text-white text-center">
|
||||
<%= t('.forgot_your_password') %>
|
||||
</h2>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
||||
<%= render "devise/shared/error_messages", resource: resource %>
|
||||
|
||||
<div class="field">
|
||||
<div class="field my-3">
|
||||
<%= f.label :email %><br />
|
||||
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
||||
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: TailwindHelper.input_classes %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit t('.send_me_reset_password_instructions') %>
|
||||
<div class="action my-3">
|
||||
<%= f.submit t('.send_me_reset_password_instructions'), class: TailwindHelper.primary_button_classes %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -39,6 +39,17 @@ Rails.application.configure do
|
||||
|
||||
config.action_mailer.perform_caching = false
|
||||
|
||||
config.action_mailer.delivery_method = :smtp
|
||||
config.action_mailer.smtp_settings = {
|
||||
user_name: ENV["MAILTRAP_USERNAME"],
|
||||
password: ENV["MAILTRAP_PASSWORD"],
|
||||
address: ENV["MAILTRAP_ADDRESS"],
|
||||
domain: ENV["MAILTRAP_DOMAIN"],
|
||||
port: ENV["MAILTRAP_PORT"],
|
||||
authentication: :cram_md5,
|
||||
}
|
||||
config.action_mailer.default_url_options = { host: ENV["MAILER_DEFAULT_URL_HOST"] }
|
||||
|
||||
# Print deprecation notices to the Rails logger.
|
||||
config.active_support.deprecation = :log
|
||||
|
||||
|
||||
@@ -64,6 +64,15 @@ Rails.application.configure do
|
||||
# config.active_job.queue_name_prefix = "x_stake_production"
|
||||
|
||||
config.action_mailer.perform_caching = false
|
||||
config.action_mailer.smtp_settings = {
|
||||
user_name: ENV["MAILGUN_SMTP_LOGIN"],
|
||||
password: ENV["MAILGUN_SMTP_PASSWORD"],
|
||||
address: ENV["MAILGUN_SMTP_SERVER"],
|
||||
domain: ENV["MAILGUN_DOMAIN"],
|
||||
port: ENV["MAILGUN_SMTP_PORT"],
|
||||
authentication: :plain,
|
||||
}
|
||||
config.action_mailer.default_url_options = { host: ENV["MAILER_DEFAULT_URL_HOST"] }
|
||||
|
||||
# Ignore bad email addresses and do not raise email delivery errors.
|
||||
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
||||
|
||||
@@ -38,6 +38,7 @@ Rails.application.configure do
|
||||
config.active_storage.service = :test
|
||||
|
||||
config.action_mailer.perform_caching = false
|
||||
config.action_mailer.default_url_options = { host: ENV["MAILER_DEFAULT_URL_HOST"] }
|
||||
|
||||
# Tell Action Mailer not to deliver emails to the real world.
|
||||
# The :test delivery method accumulates sent emails in the
|
||||
|
||||
@@ -24,7 +24,7 @@ Devise.setup do |config|
|
||||
# Configure the e-mail address which will be shown in Devise::Mailer,
|
||||
# note that it will be overwritten if you use your own mailer class
|
||||
# with default "from" parameter.
|
||||
config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
|
||||
config.mailer_sender = "no-reply@xstake.com.br"
|
||||
|
||||
# Configure the class responsible to send e-mails.
|
||||
# config.mailer = 'Devise::Mailer'
|
||||
|
||||
Reference in New Issue
Block a user