This commit is contained in:
王金磊
2023-05-04 13:41:54 +08:00
parent 9767d4cee6
commit bf807da911

View File

@@ -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'].",<br/><br/>";
$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']." <a href='https://www.tmrjournals.com/article.html?J_num=".$journal_info['journal_id']."&a_id=".$article_info['article_id']."'>article link</a>.<br/><br/>";
$tt .= "We appreciate your decision to choose <i>".$journal_info['title']."</i> 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.<br/><br/>";
$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.<br/><br/>";
$tt .= "https://www.researchgate.net<br/>https://www.academia.edu<br/>https://twitter.com<br/>https://www.linkedin.com<br/>https://www.facebook.com<br/><br/>";
$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文章列表
*/