Class: C2eCore::Drops::UsersConfirmationCodeDrop

Inherits:
BaseDrop
  • Object
show all
Defined in:
/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb

Instance Method Summary collapse

Constructor Details

#initialize(confirmation_code) ⇒ UsersConfirmationCodeDrop

Returns a new instance of UsersConfirmationCodeDrop.



6
7
8
9
# File '/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb', line 6

def initialize(confirmation_code)
  super()
  @confirmation_code = confirmation_code
end

Instance Method Details

#autofillString

Returns - SMS OTP autofill standard format. E.g.: “@consents.stage.speedlo.cloud #123456”. Must appear on the last line of the SMS, see: web.dev/web-otp/#format.

Returns:

  • (String)
    • SMS OTP autofill standard format. E.g.: “@consents.stage.speedlo.cloud #123456”.

    Must appear on the last line of the SMS, see: web.dev/web-otp/#format.



28
29
30
31
# File '/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb', line 28

def autofill
  host = @confirmation_code.originator_host.presence || "speedlo.cz"
  "@#{host} ##{@confirmation_code.value}"
end

#expires_atString

Returns - Time after which the ConfirmationCode is no longer accepted. E.g.: “11:38:56 CET”.

Returns:

  • (String)
    • Time after which the ConfirmationCode is no longer accepted. E.g.: “11:38:56 CET”.



22
23
24
# File '/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb', line 22

def expires_at
  @confirmation_code.expires_at_time_with_zone
end

#resourceString

Returns - The resource that the User is confirming. E.g.: “test@example.com” or “+420333123456”.

Returns:

  • (String)
    • The resource that the User is confirming. E.g.: “test@example.com” or “+420333123456”.



17
18
19
# File '/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb', line 17

def resource
  @confirmation_code.formatted_resource
end

#urlString?

Returns - Link to confirm the user’s email.

Returns:

  • (String, nil)
    • Link to confirm the user’s email.



34
35
36
# File '/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb', line 34

def url
  @confirmation_code.return_url
end

#valueString

Returns - Value of the ConfirmationCode. E.g.: “123456”.

Returns:

  • (String)
    • Value of the ConfirmationCode. E.g.: “123456”.



12
13
14
# File '/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb', line 12

def value
  @confirmation_code.value
end