Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
HappyKit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile
HappyKit
Commits
68bd4c05
Commit
68bd4c05
authored
Jun 12, 2019
by
gm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除无效收件人;添加失败dingding提醒
parent
c4c96bd5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
8 deletions
+35
-8
notify_release_date_by_email.rb
notify_release_date_by_email.rb
+22
-8
common.rb
rubyCommon/common.rb
+13
-0
No files found.
notify_release_date_by_email.rb
View file @
68bd4c05
...
...
@@ -2,6 +2,7 @@
require
'httparty'
require
"ostruct"
require
'mail'
require
'dingbot'
=begin
知识点:网络请求库 HTTParty
...
...
@@ -42,7 +43,7 @@ def login
end
def
today
# return Date.parse("2019-0
2-27
")
# return Date.parse("2019-0
6-10
")
return
Date
.
today
end
...
...
@@ -72,9 +73,9 @@ end
# 返回值:Deliver
def
get_deliver_info
# 以后端上线时间为准,保证程序员不被其它工作量压到下一个迭代的开发周
#
dev_event_id = "e1c8aef8-130e-40bf-8f6c-fe0e5c5dbd9c" # 提交时间
backend_deploy_event_id
=
"8389fda3-a06c-49b5-af85-788c4af12071"
# 后端上线时间
event_query
=
"subCalendarId=
#{
backend_deploy
_event_id
}
&userTimeZoneId=Asia%2FShanghai&start=
#{
dev_start_time
}
T00%3A00%3A00Z&end=
#{
dev_end_time
}
T00%3A00%3A00Z&_=1552802345400"
dev_event_id
=
"e1c8aef8-130e-40bf-8f6c-fe0e5c5dbd9c"
# 提交时间
#
backend_deploy_event_id = "8389fda3-a06c-49b5-af85-788c4af12071" # 后端上线时间
event_query
=
"subCalendarId=
#{
dev
_event_id
}
&userTimeZoneId=Asia%2FShanghai&start=
#{
dev_start_time
}
T00%3A00%3A00Z&end=
#{
dev_end_time
}
T00%3A00%3A00Z&_=1552802345400"
events
=
HTTParty
.
get
(
"http://wiki.wanmeizhensuo.com/rest/calendar-services/1.0/calendar/events.json?
#{
event_query
}
"
,
$event_headers
)
obj
=
JSON
.
parse
(
events
.
body
,
object_class:
OpenStruct
)
# 发版时间大于今天,则是这个版本的发版时间
...
...
@@ -116,10 +117,10 @@ def send_email(deliver_info)
mail
=
Mail
.
deliver
do
# 其实下面都是方法调用,不要被迷惑了
to
[
'
dujuan@igengmei.com'
,
'hualu@igengmei.com'
,
'wangjun@igengmei.com'
,
'lizhen@igengmei.com'
,
'sunwenhui@igengmei.com'
,
'tanchenshuai@igengmei.com'
,
'zhucuicui@igengmei.com'
,
'huchunhe@igengmei.com'
,
'dongqiang@igengmei.com'
,
'SJ-liuxiao
@igengmei.com'
]
#
to ['igiu_1988@126
.com']
to
[
'
hualu@igengmei.com'
,
'wangjun@igengmei.com'
,
'lizhen@igengmei.com'
,
'sunwenhui@igengmei.com'
,
'tanchenshuai@igengmei.com'
,
'zhucuicui@igengmei.com'
,
'huchunhe@igengmei.com'
,
'dongqiang@igengmei.com'
,
'SJ-liuxiao@igengmei.com'
,
'wangyang@igengmei.com'
,
'cliedn-rd
@igengmei.com'
]
#
to ['dujuan@igengmei
.com']
from
'wangyang@igengmei.com'
subject
"更美app
#{
deliver_info
.
title
}
商店物料信息"
subject
"
test 请忽略!
更美app
#{
deliver_info
.
title
}
商店物料信息"
body
"Hi,All,
#{
deliver_info
.
title
}
时间为
#{
deliver_info
.
date
.
to_s
}
,请准备商店相关的物料信息(是否更换APP icon和商店海报),谢谢~"
end
...
...
@@ -128,6 +129,19 @@ end
login
if
should_send_email_today
deliver
=
get_deliver_info
begin
send_email
deliver
# puts "发送邮件"
puts
"邮件已发送"
rescue
Exception
=>
e
puts
e
.
message
DingBot
.
endpoint
=
'https://oapi.dingtalk.com/robot/send'
DingBot
.
access_token
=
'8142e051fe21d101b7e619c179741b0502f99b66ede221e164c2c1643122378d'
message
=
DingBot
::
Message
::
Text
.
new
(
'sprintEmail 迭代发版时间邮件发送失败'
,
[
'15811315780'
],
false
)
DingBot
.
send_msg
(
message
)
end
end
rubyCommon/common.rb
0 → 100644
View file @
68bd4c05
DingBot
.
endpoint
=
'https://oapi.dingtalk.com/robot/send'
DingBot
.
access_token
=
'8142e051fe21d101b7e619c179741b0502f99b66ede221e164c2c1643122378d'
def
dingBot
message
=
DingBot
::
Message
::
Text
.
new
(
'邮件发送失败,有可能是存在无效收件人'
,
[
'15811315780'
],
false
)
DingBot
.
send_msg
(
message
)
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment