Drupalのdrupal_email()でメールを送る
Aug 12, 2015AD:
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 |
<?php function your_module_name_form_submit($form, &$form_state['values']) { drupal_mail ( // The name of your module[ 'you_need_matach_the_name_here', 'notice', 'メールアドレス', //送りたいメールアドレス 'jp',//言語 // 渡したいパラメーター arrray ( 'some_value' => $form_state['values']['some_value'], // Pass some submitted value to hook_mail ) ); } function you_need_matach_the_name_here_mail($key, &$message, $params) { if($key == 'notice') { $message['subject'] = t('Email from @site_name', array('@site_name' => variable_get('site_name', 'The site'))); $message['body'][] = t('Hello'); $message['body'][] = ''; //改行 $message['body'][] = t('フォームでサブミットされた内容はここ @value', array('@value' => $params['some_value'])); $message['body'][] = ''; //改行 $message['body'][] = t('Thanks, @the_site', array('@site_name' => variable_get('site_name', 'The site'))); } } ?> |
AD:
No Comments, Comment or Ping
Reply to “Drupalのdrupal_email()でメールを送る”
Warning: Undefined variable $user_ID in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/themes/grid_focus_public_mizo/comments.php on line 66
You must be logged in to post a comment.