fix: Use WhatsApp profile name for contacts created via Twilio (#12105)
- Use `ProfileName` parameter from Twilio WhatsApp webhooks when creating contacts - Fall back to formatted phone number for regular SMS contacts
This commit is contained in:
@@ -88,12 +88,16 @@ class Twilio::IncomingMessageService
|
||||
|
||||
def contact_attributes
|
||||
{
|
||||
name: formatted_phone_number,
|
||||
name: contact_name,
|
||||
phone_number: phone_number,
|
||||
additional_attributes: additional_attributes
|
||||
}
|
||||
end
|
||||
|
||||
def contact_name
|
||||
params[:ProfileName].presence || formatted_phone_number
|
||||
end
|
||||
|
||||
def additional_attributes
|
||||
if twilio_channel.sms?
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user