Feature: Twilio Whatsapp Integration (#779)
Twilio Whatsapp Integration Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
@@ -21,13 +21,14 @@ class ContactBuilder
|
||||
phone_number: contact_attributes[:phone_number],
|
||||
email: contact_attributes[:email],
|
||||
identifier: contact_attributes[:identifier],
|
||||
additional_attributes: contact_attributes[:identifier]
|
||||
additional_attributes: contact_attributes[:additional_attributes]
|
||||
)
|
||||
contact_inbox = ::ContactInbox.create!(
|
||||
contact_id: contact.id,
|
||||
inbox_id: inbox.id,
|
||||
source_id: source_id
|
||||
)
|
||||
|
||||
::ContactAvatarJob.perform_later(contact, contact_attributes[:avatar_url]) if contact_attributes[:avatar_url]
|
||||
contact_inbox
|
||||
rescue StandardError => e
|
||||
|
||||
@@ -15,7 +15,6 @@ class Messages::Outgoing::NormalBuilder
|
||||
|
||||
def perform
|
||||
@message = @conversation.messages.build(message_params)
|
||||
@message.save
|
||||
if @attachments.present?
|
||||
@attachments.each do |uploaded_attachment|
|
||||
attachment = @message.attachments.new(
|
||||
@@ -24,8 +23,8 @@ class Messages::Outgoing::NormalBuilder
|
||||
)
|
||||
attachment.file.attach(uploaded_attachment)
|
||||
end
|
||||
@message.save
|
||||
end
|
||||
@message.save
|
||||
@message
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user