diff --git a/app/javascript/dashboard/routes/dashboard/settings/campaigns/CampaignCard.vue b/app/javascript/dashboard/routes/dashboard/settings/campaigns/CampaignCard.vue index 9a7c04f8a..a8bc839c1 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/campaigns/CampaignCard.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/campaigns/CampaignCard.vue @@ -54,7 +54,10 @@ > {{ campaign.trigger_rules.url }} -
+
{{ messageStamp(new Date(campaign.scheduled_at), 'LLL d, h:mm a') }}
diff --git a/config/initializers/mailer.rb b/config/initializers/mailer.rb index d7359bc0e..8e5053872 100644 --- a/config/initializers/mailer.rb +++ b/config/initializers/mailer.rb @@ -27,12 +27,13 @@ Rails.application.configure do config.action_mailer.delivery_method = :smtp unless Rails.env.test? config.action_mailer.smtp_settings = smtp_settings - # You can use letter opener for your local development by setting the environment variable - config.action_mailer.delivery_method = :letter_opener if Rails.env.development? && ENV['LETTER_OPENER'] # Use sendmail if using postfix for email config.action_mailer.delivery_method = :sendmail if ENV['SMTP_ADDRESS'].blank? + # You can use letter opener for your local development by setting the environment variable + config.action_mailer.delivery_method = :letter_opener if Rails.env.development? && ENV['LETTER_OPENER'] + ######################################### # Configuration Related to Action MailBox ######################################### diff --git a/lib/seeders/account_seeder.rb b/lib/seeders/account_seeder.rb index 49e611ab5..0de483f9a 100644 --- a/lib/seeders/account_seeder.rb +++ b/lib/seeders/account_seeder.rb @@ -96,16 +96,19 @@ class Seeders::AccountSeeder def create_messages(conversation:, messages:) messages.each do |message_data| sender = find_message_sender(conversation, message_data) - conversation.messages.create!(message_data.slice('content', 'message_type').merge(account: conversation.inbox.account, sender: sender, - inbox: conversation.inbox)) + conversation.messages.create!( + message_data.slice('content', 'message_type').merge( + account: conversation.inbox.account, sender: sender, inbox: conversation.inbox + ) + ) end end def find_message_sender(conversation, message_data) if message_data['message_type'] == 'incoming' - User.find_by(email: message_data['sender']) if message_data['sender'].present? - else conversation.contact + elsif message_data['sender'].present? + User.find_by(email: message_data['sender']) end end diff --git a/lib/seeders/seed_data.yml b/lib/seeders/seed_data.yml index 542d022d0..6ca79467f 100644 --- a/lib/seeders/seed_data.yml +++ b/lib/seeders/seed_data.yml @@ -1,11 +1,11 @@ -company: +company: name: 'PaperLayer' domain: 'paperlayer.test' users: - name: 'Michael Scott' gender: male - email: 'michale@paperlayer.test' - team: + email: 'michael_scott@paperlayer.test' + team: - 'sales' - 'management' - 'administration' @@ -14,161 +14,161 @@ users: - name: 'David Wallace' gender: male email: 'david@paperlayer.test' - team: - - 'Management' + team: + - 'Management' - name: 'Deangelo Vickers' gender: male email: 'deangelo@paperlayer.test' - team: - - 'Management' + team: + - 'Management' - name: 'Jo Bennett' gender: female email: 'jo@paperlayer.test' - team: - - 'Management' + team: + - 'Management' - name: 'Josh Porter' gender: male email: 'josh@paperlayer.test' - team: - - 'Management' + team: + - 'Management' - name: 'Charles Miner' gender: male email: 'charles@paperlayer.test' - team: - - 'Management' + team: + - 'Management' - name: 'Ed Truck' gender: male email: 'ed@paperlayer.test' - team: - - 'Management' + team: + - 'Management' - name: 'Dan Gore' gender: male email: 'dan@paperlayer.test' - team: - - 'Management' + team: + - 'Management' - name: 'Craig D' gender: male email: 'craig@paperlayer.test' - team: - - 'Management' + team: + - 'Management' - name: 'Troy Underbridge' gender: male email: 'troy@paperlayer.test' - team: - - 'Management' + team: + - 'Management' - name: 'Karen Filippelli' gender: female email: 'karn@paperlayer.test' - team: + team: - 'Sales' - name: 'Danny Cordray' gender: female email: 'danny@paperlayer.test' - team: + team: - 'Sales' - name: 'Ben Nugent' gender: male email: 'ben@paperlayer.test' - team: + team: - 'Sales' - name: 'Todd Packer' gender: male email: 'todd@paperlayer.test' - team: + team: - 'Sales' - name: 'Cathy Simms' gender: female email: 'cathy@paperlayer.test' - team: + team: - 'Administration' - name: 'Hunter Jo' gender: male email: 'hunter@paperlayer.test' - team: + team: - 'Administration' - name: 'Rolando Silva' gender: male email: 'rolando@paperlayer.test' - team: + team: - 'Administration' - name: 'Stephanie Wilson' gender: female email: 'stephanie@paperlayer.test' - team: + team: - 'Administration' - name: 'Jordan Garfield' gender: male email: 'jorodan@paperlayer.test' - team: + team: - 'Administration' - name: 'Ronni Carlo' gender: male email: 'ronni@paperlayer.test' - team: + team: - 'Administration' - name: 'Lonny Collins' gender: female email: 'lonny@paperlayer.test' - team: + team: - 'Warehouse' - name: 'Madge Madsen' gender: female email: 'madge@paperlayer.test' - team: + team: - 'Warehouse' - name: 'Glenn Max' gender: female email: 'glenn@paperlayer.test' - team: + team: - 'Warehouse' - name: 'Jerry DiCanio' gender: male email: 'jerry@paperlayer.test' - team: + team: - 'Warehouse' - name: 'Phillip Martin' gender: male email: 'phillip@paperlayer.test' - team: + team: - 'Warehouse' - name: 'Michael Josh' gender: male email: 'michale_josh@paperlayer.test' - team: + team: - 'Warehouse' - name: 'Matt Hudson' gender: male email: 'matt@paperlayer.test' - team: + team: - 'Warehouse' - name: 'Gideon' gender: male email: 'gideon@paperlayer.test' - team: + team: - 'Warehouse' - name: 'Bruce' gender: male email: 'bruce@paperlayer.test' - team: + team: - 'Warehouse' - name: 'Frank' gender: male email: 'frank@paperlayer.test' - team: + team: - 'Warehouse' - - name: 'Louanne Kelley' + - name: 'Louanne Kelley' gender: female email: 'louanne@paperlayer.test' - - name: 'Devon White' + - name: 'Devon White' gender: male email: 'devon@paperlayer.test' - - name: 'Kendall' + - name: 'Kendall' gender: male email: 'kendall@paperlayer.test' - email: 'sadiq@paperlayer.test' - name: 'Sadiq' + name: 'Sadiq' gender: male -teams: +teams: - '💰 Sales' - '💼 Management' - '👩‍💼 Administration' @@ -184,21 +184,21 @@ labels: color: '#A2FDD5' show_on_sidebar: true - title: 'ops-handover' - color: '#A53326' + color: '#A53326' show_on_sidebar: true - title: 'premium-customer' color: '#6FD4EF' show_on_sidebar: true - title: 'lead' color: '#F161C8' - show_on_sidebar: true -contacts: + show_on_sidebar: true +contacts: - name: "Lorrie Trosdall" email: "ltrosdall0@bravesites.test" gender: 'female' conversations: - channel: Channel::WebWidget - messages: + messages: - message_type: incoming content: Hi, I'm having trouble logging in to my account. - message_type: outgoing @@ -209,7 +209,7 @@ contacts: gender: 'female' conversations: - channel: Channel::FacebookPage - messages: + messages: - message_type: incoming content: Hi, I need some help with my billing statement. - message_type: outgoing @@ -220,7 +220,7 @@ contacts: gender: 'female' conversations: - channel: Channel::TwitterProfile - messages: + messages: - message_type: incoming content: Hi, I think I accidentally deleted some important files. Can you help me recover them? - message_type: outgoing @@ -232,7 +232,7 @@ contacts: conversations: - channel: Channel::Whatsapp source_id: "123456723" - messages: + messages: - message_type: incoming content: Hi, I'm having trouble connecting to the internet. - message_type: outgoing @@ -244,7 +244,7 @@ contacts: conversations: - channel: Channel::Sms source_id: "+1234567" - messages: + messages: - message_type: incoming content: Hi, I'm having trouble with the mobile app. It keeps crashing. - message_type: outgoing @@ -255,7 +255,7 @@ contacts: gender: 'male' conversations: - channel: Channel::Line - messages: + messages: - message_type: incoming content: Hi, I'm trying to update my account information but it won't save. - message_type: outgoing @@ -266,7 +266,7 @@ contacts: gender: 'male' conversations: - channel: Channel::WebWidget - messages: + messages: - message_type: incoming content: Hi, I need some help setting up my new device. - message_type: outgoing @@ -277,7 +277,7 @@ contacts: gender: 'male' conversations: - channel: Channel::TwitterProfile - messages: + messages: - message_type: incoming content: Hi, I accidentally placed an order for the wrong item. Can I cancel it? - message_type: outgoing @@ -289,7 +289,7 @@ contacts: conversations: - channel: Channel::Whatsapp source_id: "12323432" - messages: + messages: - message_type: incoming content: Hi, I'm having trouble with my email. I can't seem to send or receive any messages. - message_type: outgoing @@ -301,7 +301,7 @@ contacts: conversations: - channel: Channel::Whatsapp source_id: "12342234324" - messages: + messages: - message_type: incoming content: Hi, I need some help resetting my password. - message_type: outgoing @@ -312,7 +312,7 @@ contacts: gender: 'female' conversations: - channel: Channel::FacebookPage - messages: + messages: - message_type: incoming content: Hi, I think someone may have hacked into my account. What should I do? - message_type: outgoing @@ -323,7 +323,7 @@ contacts: gender: 'male' conversations: - channel: Channel::Line - messages: + messages: - message_type: incoming content: Hi, I have a question about your product features. - message_type: outgoing @@ -335,7 +335,7 @@ contacts: conversations: - channel: Channel::Email source_id: "cdalinderc@msn.test" - messages: + messages: - message_type: incoming content: Hi, I need help setting up my new printer. - message_type: outgoing @@ -348,7 +348,7 @@ contacts: - channel: Channel::Email source_id: "mpetrukd@wunderground.test" priority: urgent - messages: + messages: - message_type: incoming content: Hi, I'm having trouble accessing a file that I shared with someone. - message_type: outgoing @@ -360,7 +360,7 @@ contacts: conversations: - channel: Channel::FacebookPage priority: high - messages: + messages: - message_type: incoming content: "Hey there,I need some help with billing, my card is not working on the website." - name: "Olia Olenchenko" @@ -370,7 +370,7 @@ contacts: - channel: Channel::WebWidget priority: high assignee: michael_scott@paperlayer.test - messages: + messages: - message_type: incoming content: "Billing section is not working, it throws some error." - name: "Elisabeth Derington" @@ -380,12 +380,12 @@ contacts: - channel: Channel::Whatsapp priority: high source_id: "1223423567" - labels: + labels: - billing - delivery - ops-handover - premium-customer - messages: + messages: - message_type: incoming content: "Hey \n I didn't get the product delivered, but it shows it is delivered to my address. Please check" - name: "Willy Castelot" @@ -394,10 +394,10 @@ contacts: conversations: - channel: Channel::WebWidget priority: medium - labels: + labels: - software - ops-handover - messages: + messages: - message_type: incoming content: "Hey there, \n I need some help with the product, my button is not working on the website." - name: "Ophelia Folkard" @@ -407,11 +407,11 @@ contacts: - channel: Channel::WebWidget priority: low assignee: michael_scott@paperlayer.test - labels: + labels: - billing - software - lead - messages: + messages: - message_type: incoming content: "Hey, \n My card is not working on your website. Please help" - name: "Candice Matherson" @@ -422,10 +422,10 @@ contacts: priority: urgent source_id: "cmathersonj@va.test" assignee: michael_scott@paperlayer.test - labels: + labels: - billing - lead - messages: + messages: - message_type: incoming content: "Hey, \n I'm looking for some help to figure out if it is the right product for me." - message_type: outgoing