From bd61ca0bae497fef876a3b8c716e70919e651474 Mon Sep 17 00:00:00 2001 From: prashant Date: Wed, 4 Nov 2015 18:10:42 +0530 Subject: mail function modifed and formated the code --- upload_code_delete.inc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'upload_code_delete.inc') diff --git a/upload_code_delete.inc b/upload_code_delete.inc index 204ac4a..25059eb 100755 --- a/upload_code_delete.inc +++ b/upload_code_delete.inc @@ -68,21 +68,31 @@ function lab_migration_upload_code_delete() drupal_set_message('Solution deleted.', 'status'); /* sending email */ - $email_to = $user->mail . ', ' . variable_get('lab_migration_emails', ''); + $email_to = $user->mail; + + $from = variable_get('lab_migration_from_email', ''); + $bcc= variable_get('lab_migration_emails', ''); + $cc=variable_get('lab_migration_cc_emails', ''); + $param['solution_deleted_user']['lab_title'] = $proposal_data->lab_title; $param['solution_deleted_user']['experiment_title'] = $experiment_data->title; $param['solution_deleted_user']['solution_number'] = $solution_data->code_number; $param['solution_deleted_user']['solution_caption'] = $solution_data->caption; - $param['example_deleted_user']['user_id'] = $user->uid; + $param['solution_deleted_user']['user_id'] = $user->uid; + $param['solution_deleted_user']['headers']=array('From'=>$from,'MIME-Version'=> '1.0', + 'Content-Type'=> 'text/plain; charset=UTF-8; format=flowed; delsp=yes', + 'Content-Transfer-Encoding' => '8Bit', + 'X-Mailer'=> 'Drupal','Cc' => $cc, 'Bcc' => $bcc); - if (!drupal_mail('lab_migration', 'solution_deleted_user', $email_to, language_default(), $param, variable_get('lab_migration_from_email', NULL), TRUE)) + if (!drupal_mail('lab_migration', 'solution_deleted_user', $email_to, language_default(), $param , $from , TRUE)) drupal_set_message('Error sending email message.', 'error'); } else { drupal_set_message('Error deleting example.', 'status'); } - drupal_goto('lab-migration/code'); + drupal_goto('lab_migration/code'); return; } + ?> -- cgit