I am relatively new to php and I have a client that has a job board on their website. When the applicant applies for a job, confirmation emails need to be sent. The website is built with the Drupal CMS and a job postings module has been installed. The module already has the function to send emails, however, the messages are stored inside the module file. I would like to have the emails in an external file.
What I am looking to do is have the confirmation email to the company with the fields the user fills out. E.g. $user for username.
To the module file I have added the following code to read the email file.
Code: Select all
function job_posting_mail($key, &$message, $params) {
$language = $message['language'];
switch ($key) {
case 'application':
$message_bod = ""
$application = fopen ("naa.email.txt", "r");
if ($application) {
while (!feof($application)) {
$buffer = fgets($application, 4096);
$message_body .= $buffer;
}
fclose($application);
}
$message['headers']['Content-Type'] = $params['content-type'];
$message['subject'] = t('!subject', array('!subject' => $params['subject']),
$language->language);
$message['body'] = $message_bod = ""
break;
Thank you very much,
Dan