Gurmukh Singh
Gurmukh Singh

Reputation: 2017

Model sends email to another model

Im looking at all these job sites, which allow users to apply for jobs posted by recruiter. When you click the apply button, it usually send the recruiter an email with some details about the user.

  1. 2 different models
  2. User clicks apply on the job posted by a recruiter
  3. an email is sent to the recruiter

Im not sure where to start? are the any gems that could help with this task, or what would be the best way in achieving this?

Upvotes: 0

Views: 43

Answers (1)

shubhs
shubhs

Reputation: 36

It's not a big deal. Use the action mailer and specify the other model (recruiter) there and the mail can be sent to the specified recruiter. It must be somehow like this.

class UserMailer < ApplicationMailer

def subscription_confirmation(recruiter,user)

@recruiter = recruiter
@user = user
mail to: recruiter.email, subject: "A New request has been Added"

end end

Upvotes: 0

Related Questions