Aggiunge IMAP bounce e flag email non valide nel CRM.
Permette di leggere i bounce dalla stessa MailIdentity SMTP, aggiornare le email in anagrafica e saltare gli indirizzi invalidi nei mailing. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
module Api
|
||||
module V1
|
||||
class MailBouncesController < BaseController
|
||||
def index
|
||||
render_agent Crm::AgentSession.new(current_user).check_mail_bounces(
|
||||
params[:project_code],
|
||||
bounce_params
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def bounce_params
|
||||
params.permit(
|
||||
:mail_identity_id,
|
||||
:from_email,
|
||||
:since_days,
|
||||
:mailbox,
|
||||
:limit
|
||||
).to_h
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,29 @@
|
||||
module Api
|
||||
module V1
|
||||
class OrganizationEmailsController < BaseController
|
||||
def update
|
||||
render_agent Crm::AgentSession.new(current_user).update_organization_email(
|
||||
params[:project_code],
|
||||
email_params
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def email_params
|
||||
params.permit(
|
||||
:organization_id,
|
||||
:contact_id,
|
||||
:email,
|
||||
:email_invalid,
|
||||
:bounced_email,
|
||||
:bounce_reason,
|
||||
:website,
|
||||
:activity_subject,
|
||||
:activity_description,
|
||||
:update_primary_contact
|
||||
).to_h
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -66,7 +66,7 @@ class ContactsController < ApplicationController
|
||||
|
||||
def contact_params
|
||||
params.require(:contact).permit(
|
||||
:organization_id, :first_name, :last_name, :role, :email, :phone, :mobile,
|
||||
:organization_id, :first_name, :last_name, :role, :email, :email_invalid, :bounced_email, :phone, :mobile,
|
||||
:preferred_contact_method, :notes, :primary_contact
|
||||
)
|
||||
end
|
||||
|
||||
@@ -57,6 +57,7 @@ class MailIdentitiesController < ApplicationController
|
||||
params.require(:mail_identity).permit(
|
||||
:name, :from_name, :from_email, :reply_to, :smtp_host, :smtp_port,
|
||||
:smtp_username, :smtp_password, :smtp_authentication, :encryption,
|
||||
:imap_host, :imap_port, :imap_enabled,
|
||||
:verify_ssl, :active
|
||||
)
|
||||
end
|
||||
|
||||
@@ -86,7 +86,7 @@ class OrganizationsController < ApplicationController
|
||||
def organization_params
|
||||
params.require(:organization).permit(
|
||||
:name, :legal_name, :organization_type, :sport, :country, :region, :province, :city,
|
||||
:address, :website, :source_url, :phone, :email, :vat_number, :notes, :status, :lead_source,
|
||||
:address, :website, :source_url, :phone, :email, :email_invalid, :bounced_email, :vat_number, :notes, :status, :lead_source,
|
||||
:assigned_user_id, :list_position, :team_gender, :streaming_status, :commercial_fit, :verified_at,
|
||||
project_ids: []
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user