I have been trying to create beta invites that each existing user can send out and was hoping to be able to use a plugin called acts_as_inviteable http://github.com/brianjlandau/acts_as_inviteable
I was wondering if anyone had direct experience with it. When I checked the console, it appears to be creating the right queries, but no email or email related errors come up.
I am tempted to just use Ryan Bates’ excellent tutorial on beta invites and write it up myself, but I’d love to have something working. We just can’t seem to figure it out.
There’s a number of problems you need to fix:
Add this line to one of your config blocks (either in
environment.rbor each of the files inconfig/environment):In
app/models/invitation.rbon line 3 you have callattr_accessible :recipient_emailthis will prevent you from mass assigning the sender. You should change it to this:Also
invitations_controller.rbshould look like this:You really can’t send an invitation unless you’re logged in (because you need a sender, which in this case is an
current_analystnot@current_user), so the lines having different logic depending on being logged in or not has been removed.Also, the email will be automatically sent by the Invitation model so calling
Mailer.deliver_invitation(@invitation, signup_url(@invitation.token))is unnecessary (and actually it would have to beAnalystInvitationMailer.deliver_invitation(@invitation))You can see a full working patch here: http://gist.github.com/290911