feat: Add support for template variables in messages content (#6215)
Fixes: #6078 Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
17
app/drops/contact_drop.rb
Normal file
17
app/drops/contact_drop.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class ContactDrop < BaseDrop
|
||||
def email
|
||||
@obj.try(:email)
|
||||
end
|
||||
|
||||
def phone_number
|
||||
@obj.try(:phone_number)
|
||||
end
|
||||
|
||||
def first_name
|
||||
@obj.try(:name).try(:split).try(:first)
|
||||
end
|
||||
|
||||
def last_name
|
||||
@obj.try(:name).try(:split).try(:last) if @obj.try(:name).try(:split).try(:size) > 1
|
||||
end
|
||||
end
|
||||
@@ -2,4 +2,12 @@ class UserDrop < BaseDrop
|
||||
def available_name
|
||||
@obj.try(:available_name)
|
||||
end
|
||||
|
||||
def first_name
|
||||
@obj.try(:name).try(:split).try(:first)
|
||||
end
|
||||
|
||||
def last_name
|
||||
@obj.try(:name).try(:split).try(:last) if @obj.try(:name).try(:split).try(:size) > 1
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user