0

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?

Gurmukh Singh
  • 1,875
  • 3
  • 24
  • 62
  • 3
    You are asking multiple questions. One of them is to how to model your data and another one is how to send an email. Please edit down to one specific problem then tell us what you have done to solve it and what went wrong. – Pooyan Khosravi Jun 15 '16 at 20:24
  • 1
    If you don't know where to start with steps 1 and 2, go through a Rails tutorial. To send an email, you don't really need a gem. [here](https://launchschool.com/blog/handling-emails-in-rails) is a tutorial. Make sure you don't accidentally put your Gmail password on Github. – max pleaner Jun 15 '16 at 20:44
  • Possible duplicate of [send email from localhost](http://stackoverflow.com/questions/1789032/send-email-from-localhost) – max pleaner Jun 15 '16 at 20:45

1 Answers1

0

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

Pinke Helga
  • 6,378
  • 2
  • 22
  • 42
shubhs
  • 36
  • 3