-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasana.php
More file actions
38 lines (29 loc) · 864 Bytes
/
asana.php
File metadata and controls
38 lines (29 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
# ASANA THIS
# by Dennis Paagman - Springest.com
# -------------------------------------------
# SETTINGS
# Array of projects with 'keyword' => 'asana id'
# Example:
# $projects = array('issue' => '123456790', 'germany' => '1234567890');
$projects = array();
# Default email address, use x+projectid if you want to post to a project by default
$to = 'x@mail.asana.com';
# -------------------------------------------
# Loop through all projects and change `to` address in case of a match
$words = explode(' ', $argv[2]);
$first_word = $words[0];
if ($projects) {
foreach ($projects as $keyword => $id) {
if ($keyword == $first_word) {
$to = "x+$id@mail.asana.com";
}
}
}
# Set email headers etc.
$headers = 'From: ' . $argv[1] . "\r\n";
$subject = $argv[2];
$message = '';
# And send!
mail($to, $subject, $message, $headers);
?>