Created
May 30, 2013 14:08
-
-
Save noniq/5678118 to your computer and use it in GitHub Desktop.
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
module FlowdockNotification | |
class SubmissionCompleted < Base | |
def submission | |
data[:submission] | |
end | |
def api_token | |
"foobarbaz" | |
end | |
def source | |
"DIE ANMELDUNG" | |
end | |
def from | |
{ name: "Robot", address: "[email protected]"} | |
end | |
def subject | |
"Abgeschickt: #{submission.project.name} – #{submission.form.human_name}" | |
end | |
def link | |
data[:admin_link] | |
end | |
def content | |
completed = submission.form.completed.count | |
not_completed = submission.form.not_completed.count | |
"<p>Dieses Formular hat bisher <strong>#{completed} abgeschickte</strong> und <strong>#{not_completed} nicht abgeschickte</strong> Anmeldungen.</p>" | |
end | |
def project | |
submission.project.name | |
end | |
end | |
end | |
# Im Controller: | |
FlowdockNotification.post :submission_completed, submission: @submission, admin_link: link_to(…) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment