From bf807da91169a3ae4a46e54d2afef92c875f6243 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E9=87=91=E7=A3=8A?= <751475802@qq.com>
Date: Thu, 4 May 2023 13:41:54 +0800
Subject: [PATCH] 1
---
application/master/controller/Article.php | 32 +++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/application/master/controller/Article.php b/application/master/controller/Article.php
index 6740671..0961bb8 100644
--- a/application/master/controller/Article.php
+++ b/application/master/controller/Article.php
@@ -529,6 +529,7 @@ class Article extends Controller {
if($aid&&$organ_res&&$ltai_res&&$author_res&&$ato_res&&$ca_au_id){
Db::commit();
$this->pushDoiToCrossref($data['doi'],$aid);
+ $this->pushEmailToAuthor($aid);
return jsonSuccess(['article_id'=>$aid]);
} else {
Db::rollback();
@@ -553,6 +554,37 @@ class Article extends Controller {
return $res;
}
+ // public function testp(){
+ // $this->pushEmailToAuthor(2551);
+ // }
+
+ private function pushEmailToAuthor($article_id){
+ $article_info = $this->article_obj->where('article_id',$article_id)->find();
+ $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
+ $stage_info = $this->journal_stage_obj->where('journal_stage_id',$article_info['journal_stage_id'])->find();
+ $authors = $this->article_author_obj->where('article_id',$article_id)->where('state',0)->select();
+
+ foreach($authors as $v){
+ if($v['email']==''){
+ continue;
+ }
+ $tt = "Dear ".$v['author_name'].",
";
+ $tt .= "We are delighted to inform you that your article has been published online in ".$journal_info['title'].". Congratulations on this significant accomplishment! Your article can be found in Vol. ".$stage_info['stage_vol']." Issue ".$stage_info['stage_no']." article link.
";
+ $tt .= "We appreciate your decision to choose ".$journal_info['title']." for publishing your research, and we hope that it has been a fulfilling experience for you. We believe that your work will be of great value to the scientific community and will contribute to the advancement of knowledge in your field.
";
+ $tt .= "To help your research reach a broader audience, we recommend utilizing the following channels: ResearchGate, Academia.edu, Twitter, LinkedIn, and Facebook. By sharing your work on these platforms, you can ensure that it receives the attention it deserves.
";
+ $tt .= "https://www.researchgate.net
https://www.academia.edu
https://twitter.com
https://www.linkedin.com
https://www.facebook.com
";
+ $tt .= "Once again, congratulations on your publication, and we look forward to receiving more manuscripts from you in the future.";
+ $maidata['email'] = $v['email'];
+ $maidata['title'] = $journal_info['title']."–".$article_info['title'];
+ $maidata['content'] = $tt;
+ $maidata['tmail'] = $journal_info['email'];
+ $maidata['tpassword'] = $journal_info['epassword'];
+ // dump($maidata);
+ Queue::push('app\api\job\mail@fire', $maidata, "mail");
+ }
+
+ }
+
/**
* 获取online文章列表
*/