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 +4 -4
- data/pg_associable/app/javascript/asociable_controller.tsx +2 -1
- data/pg_engine/app/mailers/pg_engine/base_mailer.rb +17 -11
- data/pg_engine/config/initializers/devise.rb +2 -2
- data/pg_engine/config/locales/es.yml +22 -0
- data/pg_engine/lib/pg_engine/email_observer.rb +7 -7
- data/pg_engine/lib/pg_engine/engine.rb +3 -0
- data/pg_engine/spec/mailers/previews/devise_preview.rb +13 -0
- data/pg_layout/app/views/devise/mailer/confirmation_instructions.html.erb +1 -1
- data/pg_layout/app/views/devise/mailer/email_changed.html.erb +1 -1
- data/pg_layout/app/views/devise/mailer/password_change.html.erb +1 -1
- data/pg_layout/app/views/devise/mailer/reset_password_instructions.html.erb +1 -1
- data/pg_layout/app/views/devise/mailer/unlock_instructions.html.erb +1 -1
- data/pg_rails/lib/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c5e3d8a7a2e5ca208148f212006a872999b6869a27927044fc4363d14643bd4
|
4
|
+
data.tar.gz: 6011e300a9353d344253e7404929d207688e7b5337578931d538522c2c19b77f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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', (
|
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 { @
|
6
|
-
|
7
|
-
default from:
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
-
|
18
|
-
if @
|
19
|
-
@
|
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: @
|
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['
|
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 =
|
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
|
-
|
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['
|
10
|
-
|
11
|
-
|
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
|
-
|
16
|
-
|
15
|
+
email_object = Email.create!(message_id:, subject: message.subject, to:, mailer:, status:, from_address: from,
|
16
|
+
from_name: '')
|
17
17
|
end
|
18
|
-
|
18
|
+
email_object.encoded_eml.attach({ io: StringIO.new(message.encoded), filename: "email-#{email_object.id}.eml" })
|
19
19
|
rescue StandardError => e
|
20
|
-
|
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
|
data/pg_rails/lib/version.rb
CHANGED
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.
|
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
|