pg_rails 7.0.8.pre.alpha.80 → 7.0.8.pre.alpha.81

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60b0661bbe95efdd5b745287b125b28ae41ed84671ad954d15d012f93749620a
4
- data.tar.gz: 0ebe72c73adbc1fe921b93e2a6743d2e364093e73d5b2076735eaff9f7dce021
3
+ metadata.gz: 3c5e3d8a7a2e5ca208148f212006a872999b6869a27927044fc4363d14643bd4
4
+ data.tar.gz: 6011e300a9353d344253e7404929d207688e7b5337578931d538522c2c19b77f
5
5
  SHA512:
6
- metadata.gz: a647a66a04033744632a1e42bbd79db9c8e2f958e90592a4bd763d868a63d140e3527386e3bad7cef441c9053ddd41ac3ffecabcd0046df7fd1d52f96ddd2500
7
- data.tar.gz: 477837a7b13838e1283f88a871c61f4670642e72a7c83ad885160c53e0550b3e63f1e74a8cda4897e87b51262723d87848c490662ca2dd06dac29f4cce59e041
6
+ metadata.gz: 8694882667b710bc7e4bbde02cb1bbbcf6a6a4e0202760a4fd09a866bc7ce4925e901f5f577a45d61a4f1f7b7eb67e012cdb6920730bb385e55052596bceae63
7
+ data.tar.gz: b93fd84594a60f5473bcd180af88485a646e8c62e2bb210b75f68c4c59905aad3cf689ad9078a90798c9a6e13b047f47b677f73b2c8c12a113ed30b97a11cec2
@@ -265,7 +265,7 @@ export default class extends Controller {
265
265
  this.buscando()
266
266
  }, 200)
267
267
  // console.log(`setTimeOut ${timerBuscandoId}`)
268
- document.addEventListener('turbo:before-stream-render', (i) => {
268
+ document.addEventListener('turbo:before-stream-render', () => {
269
269
  // console.log(`clear before stream render ${timerBuscandoId}`)
270
270
  clearTimeout(timerBuscandoId)
271
271
  }, { once: true })
@@ -290,6 +290,7 @@ export default class extends Controller {
290
290
  }
291
291
 
292
292
  completarCampo (target) {
293
+ // FIXME: savedInputState = null
293
294
  const textField = this.element.querySelector('input[type=text]')
294
295
  const hiddenField = this.element.querySelector('input[type=hidden]')
295
296
 
@@ -2,34 +2,40 @@ module PgEngine
2
2
  class BaseMailer < ActionMailer::Base # rubocop:disable Rails/ApplicationMailer
3
3
  class MailNotDelivered < StandardError; end
4
4
 
5
- before_action { @email = params[:email] }
6
-
7
- default from: -> { email_address_with_name(@email.from_address, @email.from_name) },
8
- reply_to: -> { @email.reply_to },
9
- subject: -> { @email.subject },
10
- to: -> { @email.to }
5
+ before_action { @email_object = params[:email_object] }
6
+
7
+ default from: lambda { |_mailer|
8
+ if @email_object.present?
9
+ email_address_with_name(@email_object.from_address, @email_object.from_name)
10
+ else
11
+ email_address_with_name(ENV.fetch('DEFAULT_MAIL_FROM'), ENV.fetch('DEFAULT_MAIL_FROM_NAME'))
12
+ end
13
+ },
14
+ reply_to: ->(_mailer) { @email_object.reply_to if @email_object.present? },
15
+ subject: ->(_mailer) { @email_object.subject if @email_object.present? },
16
+ to: ->(_mailer) { @email_object.to if @email_object.present? }
11
17
 
12
18
  layout 'pg_layout/mailer'
13
19
 
14
20
  # default delivery_method: :smtp
15
21
 
16
22
  rescue_from StandardError do |err|
17
- pg_warn err, :error
18
- if @email.present?
19
- @email.update_columns(status: :failed, status_detail: err.to_s) # rubocop:disable Rails/SkipsModelValidations
23
+ pg_err err
24
+ if @email_object.present?
25
+ @email_object.update_columns(status: :failed, status_detail: err.to_s) # rubocop:disable Rails/SkipsModelValidations
20
26
  end
21
27
  end
22
28
 
23
29
  protected
24
30
 
25
31
  def mail(*args)
26
- @footer_href = root_url(m: @email.hashid)
32
+ @footer_href = root_url(m: @email_object&.hashid)
27
33
  super(*args).tap do |message|
28
34
  # message.mailgun_options = {
29
35
  # 'tag' => email.tags,
30
36
  # 'tracking-opens' => true
31
37
  # }
32
- message['email'] = @email
38
+ message['email_object'] = @email_object if @email_object.present?
33
39
  end
34
40
  end
35
41
  end
@@ -24,13 +24,13 @@ Devise.setup do |config|
24
24
  # Configure the e-mail address which will be shown in Devise::Mailer,
25
25
  # note that it will be overwritten if you use your own mailer class
26
26
  # with default "from" parameter.
27
- config.mailer_sender = ENV.fetch('DEFAULT_MAIL_FROM', 'please-change-me-at-config-initializers-devise@example.com')
27
+ # config.mailer_sender = ""
28
28
 
29
29
  # Configure the class responsible to send e-mails.
30
30
  # config.mailer = 'Devise::Mailer'
31
31
 
32
32
  # Configure the parent class responsible to send e-mails.
33
- # config.parent_mailer = 'ActionMailer::Base'
33
+ config.parent_mailer = 'ApplicationMailer'
34
34
 
35
35
  # ==> ORM configuration
36
36
  # Load and configure the ORM. Supports :active_record (default) and
@@ -77,6 +77,28 @@ es:
77
77
  sign_up: Crear una cuenta
78
78
  forgot_your_password: ¿Olvidaste tu contraseña?
79
79
  didn_t_receive_confirmation_instructions: ¿No recibiste las instrucciones para confirmar tu cuenta?
80
+ mailer:
81
+ confirmation_instructions:
82
+ action: Confirmá tu cuenta
83
+ greeting: "Hola %{recipient}"
84
+ instruction: 'por favor, confirmá tu cuenta haciendo click en el siguiente enlace:'
85
+ subject: Confirmación de cuenta
86
+ email_changed:
87
+ greeting: "Hola %{recipient}"
88
+ message: Estamos contactando contigo para notificarte que tu email ha sido cambiado a %{email}.
89
+ message_unconfirmed: Nos estamos contactando contigo para notificarte que tu correo se está cambiando a %{email}.
90
+ subject: Email cambiado
91
+ password_change:
92
+ greeting: "Hola %{recipient}"
93
+ message: Lo estamos contactando para notificarle que su contraseña ha sido cambiada.
94
+ subject: Contraseña cambiada
95
+ reset_password_instructions:
96
+ action: Cambiar mi contraseña
97
+ greeting: "Hola %{recipient}"
98
+ instruction: "Para cambiar tu contraseña ingresá al siguiente link:"
99
+ instruction_2: Si no solicitaste cambiar tu contraseña, podés ignorar este correo.
100
+ instruction_3: Tu contraseña no será cambiada hasta que accedas al link y crees una nueva.
101
+ subject: Recuperación de contraseña
80
102
  activerecord:
81
103
  attributes:
82
104
  user:
@@ -6,18 +6,18 @@ module PgEngine
6
6
  message_id = message.message_id
7
7
  mailer = message.delivery_handler.to_s
8
8
  status = get_status(message)
9
- if message['email'].present?
10
- email = message['email'].unparsed_value
11
- email.update_columns(message_id:, mailer:, status:) # rubocop:disable Rails/SkipsModelValidations
9
+ if message['email_object'].present?
10
+ email_object = message['email_object'].unparsed_value
11
+ email_object.update_columns(message_id:, mailer:, status:) # rubocop:disable Rails/SkipsModelValidations
12
12
  else
13
13
  to = [message.to].flatten.join(', ')
14
14
  from = [message.from].flatten.join(', ')
15
- email = Email.create!(message_id:, subject: message.subject, to:, mailer:, status:, from_address: from,
16
- from_name: '')
15
+ email_object = Email.create!(message_id:, subject: message.subject, to:, mailer:, status:, from_address: from,
16
+ from_name: '')
17
17
  end
18
- email.encoded_eml.attach({ io: StringIO.new(message.encoded), filename: "email-#{email.id}.eml" })
18
+ email_object.encoded_eml.attach({ io: StringIO.new(message.encoded), filename: "email-#{email_object.id}.eml" })
19
19
  rescue StandardError => e
20
- pg_warn e, :error
20
+ pg_err e
21
21
  end
22
22
 
23
23
  def self.get_status(message)
@@ -20,6 +20,9 @@ module PgEngine
20
20
  end
21
21
 
22
22
  initializer 'configurar_pg_rails' do
23
+ # Ensure required env variables are set
24
+ ENV.fetch('DEFAULT_MAIL_FROM')
25
+ ENV.fetch('DEFAULT_MAIL_FROM_NAME')
23
26
  # SimpleForm
24
27
  require "#{PgEngine::Engine.root}/config/simple_form/simple_form"
25
28
  require "#{PgEngine::Engine.root}/config/simple_form/simple_form_bootstrap"
@@ -0,0 +1,13 @@
1
+ # Preview all emails at http://localhost:3000/rails/mailers/cliente
2
+ class DevisePreview < ActionMailer::Preview
3
+ # Preview this email at http://localhost:3000/rails/mailers/cliente/comprobante_recibido
4
+ def confirmation_instructions
5
+ # ClienteMailer.comprobante_recibido(VComprobante.find(params[:]))
6
+ Devise::Mailer.confirmation_instructions(User.first, 'TOKENN')
7
+ end
8
+
9
+ def reset_password_instructions
10
+ # ClienteMailer.comprobante_recibido(VComprobante.find(params[:]))
11
+ Devise::Mailer.reset_password_instructions(User.first, 'TOKENN')
12
+ end
13
+ end
@@ -1,4 +1,4 @@
1
- <p><%= t('.greeting', recipient: @email) %></p>
1
+ <p><%= t('.greeting', recipient: @resource.nombre) %></p>
2
2
 
3
3
  <p><%= t('.instruction') %></p>
4
4
 
@@ -1,4 +1,4 @@
1
- <p><%= t('.greeting', recipient: @email) %></p>
1
+ <p><%= t('.greeting', recipient: @resource.nombre) %></p>
2
2
 
3
3
  <% if @resource.try(:unconfirmed_email?) %>
4
4
  <p><%= t('.message_unconfirmed', email: @resource.unconfirmed_email) %></p>
@@ -1,3 +1,3 @@
1
- <p><%= t('.greeting', recipient: @resource.email) %></p>
1
+ <p><%= t('.greeting', recipient: @resource.nombre) %></p>
2
2
 
3
3
  <p><%= t('.message') %></p>
@@ -1,4 +1,4 @@
1
- <p><%= t('.greeting', recipient: @resource.email) %></p>
1
+ <p><%= t('.greeting', recipient: @resource.nombre) %></p>
2
2
 
3
3
  <p><%= t('.instruction') %></p>
4
4
 
@@ -1,4 +1,4 @@
1
- <p><%= t('.greeting', recipient: @resource.email) %></p>
1
+ <p><%= t('.greeting', recipient: @resource.nombre) %></p>
2
2
 
3
3
  <p><%= t('.message') %></p>
4
4
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.80'
4
+ VERSION = '7.0.8-alpha.81'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.8.pre.alpha.80
4
+ version: 7.0.8.pre.alpha.81
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso
@@ -1084,6 +1084,7 @@ files:
1084
1084
  - pg_engine/spec/lib/pg_engine/mailgun/log_sync_spec.rb
1085
1085
  - pg_engine/spec/lib/pg_engine/utils/pg_engine/pg_logger_spec.rb
1086
1086
  - pg_engine/spec/lib/pg_form_builder_spec.rb
1087
+ - pg_engine/spec/mailers/previews/devise_preview.rb
1087
1088
  - pg_engine/spec/models/account_spec.rb
1088
1089
  - pg_engine/spec/models/email_spec.rb
1089
1090
  - pg_engine/spec/models/mensaje_contacto_spec.rb