Class: MicrosoftGraphMailer::Client
- Inherits:
-
Object
- Object
- MicrosoftGraphMailer::Client
- Defined in:
- lib/microsoft_graph_mailer/client.rb
Instance Attribute Summary collapse
-
#azure_ad_endpoint ⇒ Object
Returns the value of attribute azure_ad_endpoint.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#graph_endpoint ⇒ Object
Returns the value of attribute graph_endpoint.
-
#tenant ⇒ Object
Returns the value of attribute tenant.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(user_id:, tenant:, client_id:, client_secret:, azure_ad_endpoint:, graph_endpoint:) ⇒ Client
constructor
A new instance of Client.
- #send_mail(message_in_mime_format) ⇒ Object
Constructor Details
#initialize(user_id:, tenant:, client_id:, client_secret:, azure_ad_endpoint:, graph_endpoint:) ⇒ Client
Returns a new instance of Client.
9 10 11 12 13 14 15 16 |
# File 'lib/microsoft_graph_mailer/client.rb', line 9 def initialize(user_id:, tenant:, client_id:, client_secret:, azure_ad_endpoint:, graph_endpoint:) @user_id = user_id @tenant = tenant @client_id = client_id @client_secret = client_secret @azure_ad_endpoint = azure_ad_endpoint @graph_endpoint = graph_endpoint end |
Instance Attribute Details
#azure_ad_endpoint ⇒ Object
Returns the value of attribute azure_ad_endpoint.
7 8 9 |
# File 'lib/microsoft_graph_mailer/client.rb', line 7 def azure_ad_endpoint @azure_ad_endpoint end |
#client_id ⇒ Object
Returns the value of attribute client_id.
7 8 9 |
# File 'lib/microsoft_graph_mailer/client.rb', line 7 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
7 8 9 |
# File 'lib/microsoft_graph_mailer/client.rb', line 7 def client_secret @client_secret end |
#graph_endpoint ⇒ Object
Returns the value of attribute graph_endpoint.
7 8 9 |
# File 'lib/microsoft_graph_mailer/client.rb', line 7 def graph_endpoint @graph_endpoint end |
#tenant ⇒ Object
Returns the value of attribute tenant.
7 8 9 |
# File 'lib/microsoft_graph_mailer/client.rb', line 7 def tenant @tenant end |
#user_id ⇒ Object
Returns the value of attribute user_id.
7 8 9 |
# File 'lib/microsoft_graph_mailer/client.rb', line 7 def user_id @user_id end |
Instance Method Details
#send_mail(message_in_mime_format) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/microsoft_graph_mailer/client.rb', line 18 def send_mail() # https://docs.microsoft.com/en-us/graph/api/user-sendmail token.post( send_mail_url, headers: { "Content-type" => "text/plain" }, body: Base64.encode64() ) end |