Class: Fastlane::Actions::SendEMailAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::SendEMailAction
- Defined in:
- lib/fastlane/plugin/send_e_mail/actions/send_e_mail_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
- .send_emails(stmpserver_address, sender_address, password, recipients, subject, message_body) ⇒ Object
Class Method Details
.authors ⇒ Object
40 41 42 |
# File 'lib/fastlane/plugin/send_e_mail/actions/send_e_mail_action.rb', line 40 def self. ["huangj"] end |
.available_options ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/fastlane/plugin/send_e_mail/actions/send_e_mail_action.rb', line 53 def self. [ # stmp servername FastlaneCore::ConfigItem.new(key: :stmp_server, env_name: "SEND_E_MAIL_STMP_SERVER", description: "servername", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :user_name, env_name: "SEND_E_MAIL_USERNAME", description: "USERNAME", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :password, env_name: "SEND_E_MAIL_PASSWORD", description: "password", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :recipients, env_name: "SEND_E_MAIL_YOUR_OPTION", description: "recipients", optional: false, type: Array), FastlaneCore::ConfigItem.new(key: :subject, env_name: "SEND_E_MAIL_YOUR_OPTION", description: "subject", optional: true, type: String), FastlaneCore::ConfigItem.new(key: :message_body, env_name: "SEND_E_MAIL_YOUR_OPTION", description: "message_body", optional: true, type: String), FastlaneCore::ConfigItem.new(key: :attachment, env_name: "SEND_E_MAIL_attachment", description: "A description of attachment", optional: true, type: String) ] end |
.description ⇒ Object
36 37 38 |
# File 'lib/fastlane/plugin/send_e_mail/actions/send_e_mail_action.rb', line 36 def self.description "a tool to sendmail" end |
.details ⇒ Object
48 49 50 51 |
# File 'lib/fastlane/plugin/send_e_mail/actions/send_e_mail_action.rb', line 48 def self.details # Optional: "send email by stmp" end |
.is_supported?(platform) ⇒ Boolean
94 95 96 97 98 99 100 101 |
# File 'lib/fastlane/plugin/send_e_mail/actions/send_e_mail_action.rb', line 94 def self.is_supported?(platform) # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example) # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform # # [:ios, :mac, :android].include?(platform) [:ios, :mac].include?(platform) true end |
.return_value ⇒ Object
44 45 46 |
# File 'lib/fastlane/plugin/send_e_mail/actions/send_e_mail_action.rb', line 44 def self.return_value # If your method provides a return value, you can describe here what it does end |
.run(params) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/fastlane/plugin/send_e_mail/actions/send_e_mail_action.rb', line 29 def self.run(params) # @params = params # UI.message("The send_e_mail plugin is working!") # self.send_emails(params[:stmpServer], params[:userName], params[:password], @params[:recipients], params[:subject], params[:message_body]) self.send_emails(params[:stmp_server], params[:user_name], params[:password], params[:recipients], params[:subject], params[:message_body]) end |
.send_emails(stmpserver_address, sender_address, password, recipients, subject, message_body) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/fastlane/plugin/send_e_mail/actions/send_e_mail_action.rb', line 10 def self.send_emails(stmpserver_address, sender_address, password, recipients, subject, ) recipients.each do |recipient_address| = '' << "From: <#{sender_address}>\r\n" << "To: <#{recipient_address}>\r\n" << "Subject: #{subject}\r\n" << "Date: " + Time.now.to_s + "\r\n" = + "\r\n" + + "\r\n" Net::SMTP.start(stmpserver_address, 25, "localhost", sender_address, password, :plain) do |smtp| # begin smtp.(, sender_address, recipient_address) # rescue # raise FileSaveError, $! # end end end end |