You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.
Class: AWS::SimpleEmailService::Identity
- Inherits:
-
Core::Resource
- Object
- Core::Resource
- AWS::SimpleEmailService::Identity
- Defined in:
- lib/aws/simple_email_service/identity.rb
Instance Attribute Summary collapse
-
#bounce_topic_arn ⇒ String
The current value of bounce_topic_arn.
-
#complaint_topic_arn ⇒ String
The current value of complaint_topic_arn.
-
#dkim_enabled ⇒ Boolean
When set to
true
, Easy DKIM signing will be enabled for email sent from this identity. -
#dkim_tokens ⇒ Array<String>
readonly
Returns a set of DNS records, or tokens, that must be published in the domain name's DNS to complete the DKIM verification process.
-
#dkim_verification_status ⇒ String
readonly
The current value of dkim_verification_status.
-
#forwarding_enabled ⇒ Boolean
(also: #forwarding_enabled?)
When
false
, complaint and bounce notifications will not be forwarded via email. -
#identity ⇒ String
readonly
Returns the email address or domain name for this identity.
-
#verification_status ⇒ String
readonly
The current value of verification_status.
-
#verification_token ⇒ String?
readonly
The current value of verification_token.
Instance Method Summary collapse
-
#bounce_topic ⇒ SNS::Topic?
-
#bounce_topic=(topic) ⇒ Object
-
#complaint_topic ⇒ SNS::Topic?
-
#complaint_topic=(topic) ⇒ Object
-
#delete ⇒ nil
Deletes the current identity.
-
#delivery_topic ⇒ SNS::Topic?
-
#delivery_topic=(topic) ⇒ Object
-
#domain? ⇒ Boolean
Returns
true
if this Identity represents a domain. -
#email_address? ⇒ Boolean
Returns
true
if this Identity represents an email address. -
#exists? ⇒ Boolean
Returns true if the identity exists.
-
#pending? ⇒ Boolean
Returns
true
if verification for this email address/domain is still pending. -
#verified? ⇒ Boolean
Returns
true
if this email address/domain has been verified. -
#verify_dkim ⇒ Array<String>
Returns an array of DKIM tokens.
Instance Attribute Details
#bounce_topic_arn ⇒ String
Returns the current value of bounce_topic_arn
39 40 41 |
# File 'lib/aws/simple_email_service/identity.rb', line 39 def bounce_topic_arn @bounce_topic_arn end |
#complaint_topic_arn ⇒ String
Returns the current value of complaint_topic_arn
39 40 41 |
# File 'lib/aws/simple_email_service/identity.rb', line 39 def complaint_topic_arn @complaint_topic_arn end |
#dkim_enabled ⇒ Boolean
When set to true
, Easy DKIM signing will
be enabled for email sent from this identity.
39 40 41 |
# File 'lib/aws/simple_email_service/identity.rb', line 39 def dkim_enabled @dkim_enabled end |
#dkim_tokens ⇒ Array<String> (readonly)
Returns a set of DNS records, or tokens, that must be published in the domain name's DNS to complete the DKIM verification process. Call #verify_dkim if this returns an empty list.
39 40 41 |
# File 'lib/aws/simple_email_service/identity.rb', line 39 def dkim_tokens @dkim_tokens end |
#dkim_verification_status ⇒ String (readonly)
Returns the current value of dkim_verification_status
39 40 41 |
# File 'lib/aws/simple_email_service/identity.rb', line 39 def dkim_verification_status @dkim_verification_status end |
#forwarding_enabled ⇒ Boolean Also known as: forwarding_enabled?
When false
, complaint and bounce
notifications will not be forwarded via email. Can only be set to
false
when there is both a bounce_topic
and complaint_topic
.
39 40 41 |
# File 'lib/aws/simple_email_service/identity.rb', line 39 def forwarding_enabled @forwarding_enabled end |
#identity ⇒ String (readonly)
Returns the email address or domain name for this identity.
49 50 51 |
# File 'lib/aws/simple_email_service/identity.rb', line 49 def identity @identity end |
#verification_status ⇒ String (readonly)
Returns the current value of verification_status
39 40 41 |
# File 'lib/aws/simple_email_service/identity.rb', line 39 def verification_status @verification_status end |
#verification_token ⇒ String? (readonly)
Returns the current value of verification_token
39 40 41 |
# File 'lib/aws/simple_email_service/identity.rb', line 39 def verification_token @verification_token end |
Instance Method Details
#bounce_topic ⇒ SNS::Topic?
124 125 126 127 128 |
# File 'lib/aws/simple_email_service/identity.rb', line 124 def bounce_topic if arn = bounce_topic_arn SNS::Topic.new(arn, :config => config) end end |
#bounce_topic=(topic) ⇒ Object
118 119 120 121 |
# File 'lib/aws/simple_email_service/identity.rb', line 118 def bounce_topic= topic arn = topic.respond_to?(:arn) ? topic.arn : topic self.bounce_topic_arn = arn end |
#complaint_topic ⇒ SNS::Topic?
138 139 140 141 142 |
# File 'lib/aws/simple_email_service/identity.rb', line 138 def complaint_topic if arn = complaint_topic_arn SNS::Topic.new(arn, :config => config) end end |
#complaint_topic=(topic) ⇒ Object
132 133 134 135 |
# File 'lib/aws/simple_email_service/identity.rb', line 132 def complaint_topic= topic arn = topic.respond_to?(:arn) ? topic.arn : topic self.complaint_topic_arn = arn end |
#delete ⇒ nil
Deletes the current identity.
170 171 172 173 |
# File 'lib/aws/simple_email_service/identity.rb', line 170 def delete client.delete_identity(:identity => identity) nil end |
#delivery_topic ⇒ SNS::Topic?
110 111 112 113 114 |
# File 'lib/aws/simple_email_service/identity.rb', line 110 def delivery_topic if arn = delivery_topic_arn SNS::Topic.new(arn, :config => config) end end |
#delivery_topic=(topic) ⇒ Object
104 105 106 107 |
# File 'lib/aws/simple_email_service/identity.rb', line 104 def delivery_topic= topic arn = topic.respond_to?(:arn) ? topic.arn : topic self.delivery_topic_arn = arn end |
#domain? ⇒ Boolean
Returns true
if this AWS::SimpleEmailService::Identity represents a
domain.
152 153 154 |
# File 'lib/aws/simple_email_service/identity.rb', line 152 def domain? !email_address? end |
#email_address? ⇒ Boolean
Returns true
if this AWS::SimpleEmailService::Identity represents an
email address.
146 147 148 |
# File 'lib/aws/simple_email_service/identity.rb', line 146 def email_address? identity.match(/@/) ? true : false end |
#exists? ⇒ Boolean
Returns true if the identity exists.
176 177 178 179 180 |
# File 'lib/aws/simple_email_service/identity.rb', line 176 def exists? = { :identities => [identity] } resp = client.get_identity_verification_attributes() !!resp[:verification_attributes][identity] end |
#pending? ⇒ Boolean
Returns true
if verification for this email
address/domain is still pending.
164 165 166 |
# File 'lib/aws/simple_email_service/identity.rb', line 164 def pending? verification_status == 'Pending' end |
#verified? ⇒ Boolean
Returns true
if this email address/domain has
been verified.
158 159 160 |
# File 'lib/aws/simple_email_service/identity.rb', line 158 def verified? verification_status == 'Success' end |
#verify_dkim ⇒ Array<String>
Returns an array of DKIM tokens.
93 94 95 96 97 98 99 100 |
# File 'lib/aws/simple_email_service/identity.rb', line 93 def verify_dkim if domain? resp = client.verify_domain_dkim(:domain => identity) resp[:dkim_tokens] else raise "unable to verify dkim for an email address" end end |