Class: AWS::SimpleEmailService::Identity

Inherits:
Core::Resource
  • Object
show all
Defined in:
lib/aws/simple_email_service/identity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bounce_topic_arnString



39
40
41
# File 'lib/aws/simple_email_service/identity.rb', line 39

def bounce_topic_arn
  @bounce_topic_arn
end

#complaint_topic_arnString



39
40
41
# File 'lib/aws/simple_email_service/identity.rb', line 39

def complaint_topic_arn
  @complaint_topic_arn
end

#dkim_enabledBoolean

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_tokensArray<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_statusString (readonly)



39
40
41
# File 'lib/aws/simple_email_service/identity.rb', line 39

def dkim_verification_status
  @dkim_verification_status
end

#forwarding_enabledBoolean 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

#identityString (readonly)



49
50
51
# File 'lib/aws/simple_email_service/identity.rb', line 49

def identity
  @identity
end

#verification_statusString (readonly)



39
40
41
# File 'lib/aws/simple_email_service/identity.rb', line 39

def verification_status
  @verification_status
end

#verification_tokenString? (readonly)



39
40
41
# File 'lib/aws/simple_email_service/identity.rb', line 39

def verification_token
  @verification_token
end

Instance Method Details

#bounce_topicSNS::Topic?



107
108
109
110
111
# File 'lib/aws/simple_email_service/identity.rb', line 107

def bounce_topic
  if arn = bounce_topic_arn
    SNS::Topic.new(arn, :config => config)
  end
end

#bounce_topic=(topic) ⇒ Object



101
102
103
104
# File 'lib/aws/simple_email_service/identity.rb', line 101

def bounce_topic= topic
  arn = topic.respond_to?(:arn) ? topic.arn : topic
  self.bounce_topic_arn = arn
end

#complaint_topicSNS::Topic?



121
122
123
124
125
# File 'lib/aws/simple_email_service/identity.rb', line 121

def complaint_topic
  if arn = complaint_topic_arn
    SNS::Topic.new(arn, :config => config)
  end
end

#complaint_topic=(topic) ⇒ Object



115
116
117
118
# File 'lib/aws/simple_email_service/identity.rb', line 115

def complaint_topic= topic
  arn = topic.respond_to?(:arn) ? topic.arn : topic
  self.complaint_topic_arn = arn
end

#deletenil

Deletes the current identity.



153
154
155
156
# File 'lib/aws/simple_email_service/identity.rb', line 153

def delete
  client.delete_identity(:identity => identity)
  nil
end

#domain?Boolean



135
136
137
# File 'lib/aws/simple_email_service/identity.rb', line 135

def domain?
  !email_address?
end

#email_address?Boolean



129
130
131
# File 'lib/aws/simple_email_service/identity.rb', line 129

def email_address?
  identity.match(/@/) ? true : false
end

#exists?Boolean



159
160
161
162
163
# File 'lib/aws/simple_email_service/identity.rb', line 159

def exists?
  options = { :identities => [identity] }
  resp = client.get_identity_verification_attributes(options)
  !!resp[:verification_attributes][identity]
end

#pending?Boolean



147
148
149
# File 'lib/aws/simple_email_service/identity.rb', line 147

def pending?
  verification_status == 'Pending'
end

#verified?Boolean



141
142
143
# File 'lib/aws/simple_email_service/identity.rb', line 141

def verified?
  verification_status == 'Success'
end

#verify_dkimArray<String>



90
91
92
93
94
95
96
97
# File 'lib/aws/simple_email_service/identity.rb', line 90

def verify_dkim
  if domain?
    resp = client.verify_domain_dkim(:domain => identity)
    reps[:dkim_tokens]
  else
    raise "unable to verify dkim for an email address"
  end
end