Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invitation mail #337

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion application/controllers/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public function pay() {
$this->user->set_paid($data['id']);
$query= $this->user->get_user_by_id($data['id']);
$mail = $query['mail'];
$this->email->send_fee_received_mail($mail, $data['school'], $data['bill']);
$association_name = $query['association_name'];
$this->email->send_fee_received_and_invitation_mail($mail, $data['school'], $data['bill'], $association_name);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

空行删掉

$response = array(
'code' => '0',
'msg' => '操作成功!'
Expand Down
34 changes: 29 additions & 5 deletions application/libraries/MY_Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,37 @@ public function send_account_confirm_mail($mail) {
}

/*
* Send mail after money is received.
* Send mail of confirmation and invitation after money is received.
* $subject and $invitation needs to be updated.
*/
public function send_fee_received_mail($mail, $school, $fee) {
$subject = '第十六届全国高校自行车交流赛缴费确认';
public function send_fee_received_and_invitation_mail($mail, $school, $fee, $association_name) {
$subject = '第十六届全国高校自行车交流赛缴费确认及邀请函';
$id = $this->ci->user->get_id($mail);
$id_message='<br><br>贵高校本次比赛的ID是<b>' . $id . '</b>,请领队同学务必牢记,并在比赛签到时出示。<br><br>祝好!<br><br>北京大学自行车协会';
$message = $school . ',<br><br>贵校车协交来的' . $fee . '元参赛费用已经收到,感谢你们对北大赛的大力支持!如有任何问题,请直接与各地区负责联系。' . $id_message;
$invitation_message = '
<div style="background-image: url(\'https://s2.ax1x.com/2019/03/09/ASQKuF.md.jpg\'); background-size:100% 100%; width: 900px; height: 600px; z-index: -1; display: inline-block;">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

从这里开始到div结束的缩进要调一下

</div>
<br><br><br>

<div style="background-image: url(\'https://s2.ax1x.com/2019/03/09/ASQ4Ej.md.jpg\'); background-size:100% 100%; width: 900px; height: 600px; z-index: -1; display: inline-block;">
<div style="position: relative; width: 600px; height: 400px; left: 300px; top: 100px;">
<p style="font-size: 25px; font-weight: bold;">
致 ' . $school . ' ' . $association_name . ':
</p>
<p style="font-size: 25px;">
北京大学自行车协会将于5月4日、5日和6日分别在北京大学和河北廊坊市固安县永定河自行车公园举办“北大车协 · 第十六届全国高校自行车交流赛”。本届比赛由xxx举办,并得到了xxx的大力支持。<br>
贵协作为全国知名的高校自行车运动社团,协会会员自行车运动水平优秀,学生素质高尚优良。我们诚挚邀请贵协参加“北大车协 · 第十六届全国高校自行车交流赛”, 以车会友,交流学习。
</p>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删空行

<p style="text-align: center; position: relative; left: 350px; width: 250px; font-size: 25px; font-weight: bold;">
北京大学自行车协会<br>
2018年4月
</p>
<img src="https://s2.ax1x.com/2019/03/09/ASQI5n.png" style="width: 150px; height: 50px; position: relative; left: 400px; top: 0px;">
</div>
</div>
';
$message = $school . ',<br><br>贵校车协交来的' . $fee . '元参赛费用已经收到,感谢你们对北大赛的大力支持!如有任何问题,请直接与各地区负责联系。' . $id_message.'<br><br><br>以下是第十六届全国高校自行车交流赛邀请函,可截图保存:<br><br>'.$invitation_message;
$this->send_mail($mail, $subject, $message);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

奇怪的空格要删掉

}