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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
<?php
/**
* Implementation of hook_mail().
*/
function osdag_workshop_booking_mail($key, &$message, $params)
{
global $user;
$language = $message['language'];
switch ($key)
{
case 'proposal_received':
/* initializing data */
$proposal_q = db_query("SELECT * FROM {osdag_workshop_booking_proposal} WHERE id = %d LIMIT 1", $params['proposal_received']['proposal_id']);
$proposal_data = db_fetch_object($proposal_q);
$user_data = user_load($params['proposal_received']['user_id']);
$message['headers'] = $params['proposal_received']['headers'];
$message['subject'] = t('[!site_name][Workshop Booking] Your request for osdag workshop has been received', array(
'!site_name' => variable_get('site_name', '')
), array(
'language' => $language->language
));
$message['body'] = array(
'body' => t('
Dear !user_name,
We have received your request for osdag workshop.
Your request is under review and you will soon receive an email from us regarding the same.
Best Wishes,
Osdag Team,
FOSSEE, IIT Bombay', array(
'!site_name' => variable_get('site_name', ''),
'!user_name' => $user_data->name
), array(
'language' => $language->language
))
);
break;
case 'proposal_approved':
/* initializing data */
$proposal_q = db_query("SELECT * FROM {osdag_workshop_booking_proposal} WHERE id = %d LIMIT 1", $params['proposal_approved']['proposal_id']);
$proposal_data = db_fetch_object($proposal_q);
$user_data = user_load($params['proposal_approved']['user_id']);
$message['headers'] = $params['proposal_approved']['headers'];
$message['subject'] = t('[!site_name][Workshop Booking] Your request for osdag workshop has been approved', array(
'!site_name' => variable_get('site_name', '')
), array(
'language' => $language->language
));
$message['body'] = array(
'body' => t('
Dear !user_name,
Your request for osdag workshop has been approved.
Our team will contact you on email regarding the same.
Best Wishes,
Osdag Team,
FOSSEE, IIT Bombay', array(
'!site_name' => variable_get('site_name', ''),
'!user_name' => $user_data->name
), array(
'language' => $language->language
))
);
break;
case 'proposal_disapproved':
/* initializing data */
$proposal_q = db_query("SELECT * FROM {osdag_workshop_booking_proposal} WHERE id = %d LIMIT 1", $params['proposal_disapproved']['proposal_id']);
$proposal_data = db_fetch_object($proposal_q);
$user_data = user_load($params['proposal_disapproved']['user_id']);
$message['headers'] = $params['proposal_disapproved']['headers'];
$message['subject'] = t('[!site_name][Workshop Booking] Your request for osdag workshop has been disapproved', array(
'!site_name' => variable_get('site_name', '')
), array(
'language' => $language->language
));
$message['body'] = array(
'body' => t('
Dear !user_name,
We have received your request for osdag workshop.
Your request is under review and you will soon receive an email from us regarding the same.
Best Wishes,
Osdag Team,
FOSSEE, IIT Bombay', array(
'!site_name' => variable_get('site_name', ''),
'!user_name' => $user_data->name
), array(
'language' => $language->language
))
);
break;
}
}
|