fastlane-plugin-gmail_notify 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad31026dd478b6c8d648ecbecc922ffc5d0d63833fd3a1a08cfd1ed8f3102cb3
|
4
|
+
data.tar.gz: 6f2ecf816e9a80246cc199fd5ee10ee9518385e4bcd7abf041239748a189047a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c74c93a9bfc88377e0af44f23a14908c783e176d6cd769fe665fac6e98f1d06a3626980bcddd933e1b975f11cea5172ef3b66a0fefcd2c3e965ed2c026c86b30
|
7
|
+
data.tar.gz: 4a02e606937aea78192fb2d371c3a14d77c1a621ca1399ad126e569561db860ce9e26e6e09f1ef64226487206cf5973f53b0bce7cef5727a9ce1733d064414ed
|
data/README.md
CHANGED
@@ -14,13 +14,40 @@ fastlane add_plugin gmail_notify
|
|
14
14
|
|
15
15
|
Sends a mail using SMTP
|
16
16
|
|
17
|
-
|
17
|
+
`gmail_notify` allows you to send a gmail using smtp so that you can notify the team about a new release.
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
To get started you must have a gmail and [app password](https://knowledge.workspace.google.com/kb/how-to-generate-an-app-passwords-000009237) generated.
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
gmail_notify(
|
25
|
+
smtp_email: "<sender email>",
|
26
|
+
smtp_password: "<app password>",
|
27
|
+
recipients: "<recipients comma separated>",
|
28
|
+
cc: "<cc>",
|
29
|
+
subject: "<gmail subject>",
|
30
|
+
template_file: "<path to mail template>",
|
31
|
+
placeholders: {
|
32
|
+
var1: "world"
|
33
|
+
}
|
34
|
+
)
|
35
|
+
```
|
36
|
+
|
37
|
+
The mail body is constructed using a [html template](template.html) file. The value for variables in the template file can be provided in the placeholder hash.
|
18
38
|
|
19
|
-
|
39
|
+
### Parameters
|
20
40
|
|
21
|
-
|
41
|
+
| Key | Description |
|
42
|
+
|-----------------|--------------------|
|
43
|
+
| `smtp_email` | Email account for smtp authentication (Sender's email) |
|
44
|
+
| `smtp_password` | Password for smtp authentication |
|
45
|
+
| `recipients` | Comma separated list of recipients |
|
46
|
+
| `cc` | Comma separated list of cc |
|
47
|
+
| `subject` | Email subject |
|
48
|
+
| `template_file` | Path to template file |
|
49
|
+
| `placeholders` | Hash that contains value of variables in the template |
|
22
50
|
|
23
|
-
**Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
|
24
51
|
|
25
52
|
## Run tests for this plugin
|
26
53
|
|
@@ -13,7 +13,10 @@ module Fastlane
|
|
13
13
|
|
14
14
|
body = ERB.new(File.read(params[:template_file]), trim_mode: nil).result_with_hash(params[:placeholders])
|
15
15
|
|
16
|
-
|
16
|
+
begin
|
17
|
+
retries ||= 0
|
18
|
+
|
19
|
+
Pony.mail({
|
17
20
|
to: params[:recipients],
|
18
21
|
cc: params[:cc],
|
19
22
|
subject: params[:subject],
|
@@ -24,12 +27,21 @@ module Fastlane
|
|
24
27
|
address: "smtp.gmail.com",
|
25
28
|
port: "587",
|
26
29
|
enable_starttls_auto: true,
|
27
|
-
user_name: params[:
|
28
|
-
password: params[:
|
30
|
+
user_name: params[:smtp_email],
|
31
|
+
password: params[:smtp_password],
|
29
32
|
authentication: :plain, # :plain, :login, :cram_md5, no auth by default
|
30
33
|
domain: "localhost.localdomain" # the HELO domain provided by the client to the server
|
31
34
|
}
|
32
35
|
})
|
36
|
+
rescue Net::ReadTimeout
|
37
|
+
if (retries += 1) < 5
|
38
|
+
puts("retrying ##{retries}")
|
39
|
+
sleep(5)
|
40
|
+
retry
|
41
|
+
else
|
42
|
+
raise
|
43
|
+
end
|
44
|
+
end
|
33
45
|
end
|
34
46
|
|
35
47
|
def self.test(params)
|
@@ -59,12 +71,12 @@ module Fastlane
|
|
59
71
|
|
60
72
|
def self.available_options
|
61
73
|
[
|
62
|
-
FastlaneCore::ConfigItem.new(key: :
|
74
|
+
FastlaneCore::ConfigItem.new(key: :smtp_email,
|
63
75
|
env_name: "GMAIL_NOTIFY_SENDER_EMAIL",
|
64
76
|
description: "Gmail account to login with",
|
65
77
|
optional: false,
|
66
78
|
type: String),
|
67
|
-
FastlaneCore::ConfigItem.new(key: :
|
79
|
+
FastlaneCore::ConfigItem.new(key: :smtp_password,
|
68
80
|
env_name: "GMAIL_NOTIFY_SENDER_PASSWORD",
|
69
81
|
description: "Password of Gmail account to login with",
|
70
82
|
optional: false,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-gmail_notify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antony Leons
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pony
|