Feature: Twilio Whatsapp Integration (#779)

Twilio Whatsapp Integration

Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Pranav Raj S
2020-04-30 01:41:13 +05:30
committed by GitHub
parent 168042f9a4
commit 0cb7333977
23 changed files with 238 additions and 81 deletions

View File

@@ -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

View File

@@ -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