-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,24 @@ | |||
<!-- | |||
Set overlay: true in the config | |||
This file will be rendered on the overlay | |||
The below code sample is taken from the Pivotal App | |||
--> | |||
|
|||
<h3>Edit the Story Details</h3> | |||
{{#each tickets}} | |||
{{#ticket}} | |||
<ol> | |||
<li> | |||
<label for="title">Story Title</label> | |||
<input name="title" value="{{subject}}"> | |||
</li> | |||
<li> | |||
<label for="description">Story Description</label> | |||
<textarea name="description"> | |||
{{content.text}} \n | |||
https://{{../../company.subdomain}}.supportbee.com/tickets/{{id}} | |||
</textarea> | |||
</li> | |||
</ol> | |||
{{/ticket}} | |||
{{/each}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,32 @@ | |||
name: Email_after_archive | |||
slug: email_after_archive | |||
access: public | |||
|
|||
description: "This is to test and a boilerplate app. | |||
Accepts newline" | |||
|
|||
category: Integration | |||
|
|||
tags: | |||
- tag1 | |||
- tag2 | |||
|
|||
developer: | |||
name: <Your Name> | |||
email: <Your Email> | |||
twitter: "<Your Twitter Handle>" | |||
github: <Your Github Handle> | |||
|
|||
# The following config keys are used by Action Handlers | |||
# Set button 'overlay' to true, if you want to have an overlay | |||
# The valid values for screens are [ticket, all, unassigned, my, groups] | |||
# Remove the following section if you do not want to define Action Handlers | |||
|
|||
action: | |||
button: | |||
overlay: false | |||
screens: | |||
- ticket | |||
- all | |||
- unassigned | |||
label: Send To Email_after_archive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,53 @@ | |||
module EmailAfterArchive | |||
module EventHandler | |||
# Handle 'ticket.created' event | |||
def ticket_created | |||
return true | |||
end | |||
|
|||
def ticket_archived | |||
recd_user = payload.agent.email | |||
RestClient.post "https://api:#{settings.API_KEY}" \ | |||
"@api.mailgun.net/v2/#{mailgun_domain}/messages", | |||
:from => "Excited User <rajat188@gmail.com>", | |||
:to => "#{payload.agent.email}", | |||
:subject => "#{settings.subject}", | |||
:text => "#{settings.email_body}" | |||
end | |||
|
|||
# Handle all events | |||
def all_events | |||
return true | |||
end | |||
end | |||
end | |||
|
|||
module EmailAfterArchive | |||
module ActionHandler | |||
def button | |||
# Handle Action here | |||
[200, "Success"] | |||
end | |||
end | |||
end | |||
|
|||
module EmailAfterArchive | |||
class Base < SupportBeeApp::Base | |||
# Define Settings | |||
string :API_KEY, :required => true, :hint => 'This is the API Key from mailgun console' | |||
string :subject, :required => true, :hint => 'Say Hello to your customers' | |||
string :email_body, :required => true, :hint => 'The body of the email' | |||
string :mailgun_domain, :required => true, :hint => 'The sub domain available in mailgun' | |||
# string :name, :required => true, :hint => 'Tell me your name' | |||
# string :username, :required => true, :label => 'User Name' | |||
# password :password, :required => true | |||
# boolean :notify_me, :default => true, :label => 'Notify Me' | |||
|
|||
# White list settings for logging | |||
# white_list :name, :username | |||
|
|||
# Define public and private methods here which will be available | |||
# in the EventHandler and ActionHandler modules | |||
end | |||
end | |||
|