Class: SendCustomMail

Inherits:
UserMailer
  • Object
show all
Defined in:
lib/sendCustomMail.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from UserMailer

#send_email

Constructor Details

#initialize(user_email, action_type) ⇒ SendCustomMail

Returns a new instance of SendCustomMail.



6
7
8
9
# File 'lib/sendCustomMail.rb', line 6

def initialize(user_email, action_type)
	@user_email = user_email
  @action_type = action_type
end

Instance Attribute Details

#action_typeObject (readonly)

Returns the value of attribute action_type.



4
5
6
# File 'lib/sendCustomMail.rb', line 4

def action_type
  @action_type
end

#user_emailObject (readonly)

Returns the value of attribute user_email.



4
5
6
# File 'lib/sendCustomMail.rb', line 4

def user_email
  @user_email
end

Instance Method Details

#processObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/sendCustomMail.rb', line 11

def process
  if @action_type == "PROFILE"
@message = "Profile updated successfully."
	end
	
	if @action_type == "ORDER"
@message = "Order placed successfully."
	end
	
	UserMailer.new.send_email(@user_email, @message)
end