feat: Ability to receive location on whatsapp inbox (#5742)

- Ability to  receive location messages on WhatsApp Inbox

ref: https://github.com/chatwoot/chatwoot/issues/3398

Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
salman652
2022-11-08 10:36:47 +05:00
committed by GitHub
parent 20406dce01
commit 6ff0c93659
5 changed files with 88 additions and 19 deletions

View File

@@ -66,7 +66,21 @@ unless Rails.env.production?
# sample email collect
Seeders::MessageSeeder.create_sample_email_collect_message conversation
Message.create!(content: 'Hello', account: account, inbox: inbox, conversation: conversation, message_type: :incoming)
Message.create!(content: 'Hello', account: account, inbox: inbox, conversation: conversation, sender: contact_inbox.contact,
message_type: :incoming)
# sample location message
#
location_message = Message.new(content: 'location', account: account, inbox: inbox, sender: contact_inbox.contact, conversation: conversation,
message_type: :incoming)
location_message.attachments.new(
account_id: account.id,
file_type: 'location',
coordinates_lat: 37.7893768,
coordinates_long: -122.3895553,
fallback_title: 'Bay Bridge, San Francisco, CA, USA'
)
location_message.save!
# sample card
Seeders::MessageSeeder.create_sample_cards_message conversation