/[drupal]/contributions/modules/messaging/messaging_mime_mail/messaging_mime_mail.module
ViewVC logotype

Contents of /contributions/modules/messaging/messaging_mime_mail/messaging_mime_mail.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Mon Mar 10 16:08:04 2008 UTC (20 months, 2 weeks ago) by timcullen
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -0 lines
File MIME type: text/x-php
Added div with padding to better format email.
1 <?php
2 /**
3 * @file
4 * Mime mail using Drupal API. Messaging method plug-in
5 */
6
7 /**
8 * Implementation of hook_messaging
9 */
10 function messaging_mime_mail_messaging($op = 'info') {
11 switch($op) {
12 case 'send methods':
13 $info['mail'] = array(
14 'name' => t('Mime Mail'), // Name for display
15 'destination' => 'mail', // Account property to use as destination
16 'send' => 'messaging_mime_mail_send', // Sending callback
17 'type' => MESSAGING_TYPE_PUSH, // Method type: push || pull
18 'glue' => "<BR>",
19 'footer' => "<BR><BR>", // Separator for message footer
20 );
21 return $info;
22 }
23 }
24
25 /**
26 * Send mime mail message to user account
27 *
28 * @param $destination
29 * Array of e-mails
30 * @param $message
31 * Message array
32 */
33 function messaging_mime_mail_send($destination, $message) {
34 $mailkey = 'message-'.$message['type'];
35 $count = 0;
36 foreach ($destination as $to) {
37 $message['body'] = "<div style='padding: 20px; margin: 10px;'>" . $message['body'] . "</div>";
38 $count += mimemail(variable_get('site_mail', ini_get('sendmail_from')), $to, $message['subject'], $message['body'], NULL,array(),NULL,array(),$mailkey) ? 1 : 0;
39 }
40 return $count;
41 }
42

  ViewVC Help
Powered by ViewVC 1.1.2