Class: Appwrite::Models::EmailTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/appwrite/models/email_template.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template_id:, locale:, message:, sender_name:, sender_email:, reply_to_email:, reply_to_name:, subject:) ⇒ EmailTemplate

Returns a new instance of EmailTemplate.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/appwrite/models/email_template.rb', line 15

def initialize(
    template_id:,
    locale:,
    message:,
    sender_name:,
    sender_email:,
    reply_to_email:,
    reply_to_name:,
    subject:
)
    @template_id = template_id
    @locale = locale
    @message = message
    @sender_name = sender_name
    @sender_email = sender_email
    @reply_to_email = reply_to_email
    @reply_to_name = reply_to_name
    @subject = subject
end

Instance Attribute Details

#localeObject (readonly)

Returns the value of attribute locale.



7
8
9
# File 'lib/appwrite/models/email_template.rb', line 7

def locale
  @locale
end

#messageObject (readonly)

Returns the value of attribute message.



8
9
10
# File 'lib/appwrite/models/email_template.rb', line 8

def message
  @message
end

#reply_to_emailObject (readonly)

Returns the value of attribute reply_to_email.



11
12
13
# File 'lib/appwrite/models/email_template.rb', line 11

def reply_to_email
  @reply_to_email
end

#reply_to_nameObject (readonly)

Returns the value of attribute reply_to_name.



12
13
14
# File 'lib/appwrite/models/email_template.rb', line 12

def reply_to_name
  @reply_to_name
end

#sender_emailObject (readonly)

Returns the value of attribute sender_email.



10
11
12
# File 'lib/appwrite/models/email_template.rb', line 10

def sender_email
  @sender_email
end

#sender_nameObject (readonly)

Returns the value of attribute sender_name.



9
10
11
# File 'lib/appwrite/models/email_template.rb', line 9

def sender_name
  @sender_name
end

#subjectObject (readonly)

Returns the value of attribute subject.



13
14
15
# File 'lib/appwrite/models/email_template.rb', line 13

def subject
  @subject
end

#template_idObject (readonly)

Returns the value of attribute template_id.



6
7
8
# File 'lib/appwrite/models/email_template.rb', line 6

def template_id
  @template_id
end

Class Method Details

.from(map:) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/appwrite/models/email_template.rb', line 35

def self.from(map:)
    EmailTemplate.new(
        template_id: map["templateId"],
        locale: map["locale"],
        message: map["message"],
        sender_name: map["senderName"],
        sender_email: map["senderEmail"],
        reply_to_email: map["replyToEmail"],
        reply_to_name: map["replyToName"],
        subject: map["subject"]
    )
end

Instance Method Details

#to_mapObject



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/appwrite/models/email_template.rb', line 48

def to_map
    {
        "templateId": @template_id,
        "locale": @locale,
        "message": @message,
        "senderName": @sender_name,
        "senderEmail": @sender_email,
        "replyToEmail": @reply_to_email,
        "replyToName": @reply_to_name,
        "subject": @subject
    }
end