• I am trying to use this plugin to send invites from a page other than the member profile page. The plugin was definitely not designed to do this, and I’m trying to avoid having to totally hack the plugin.

    Here’s what I’ve done so far:
    * create my own plugin, which requires invite-anyone.php
    * the Invite Anyone plugin enqueues some CSS and JS in by-email/by-email.php, so I enqueued the same CSS and JS in my plugin on the page where I need it
    * put the function invite_anyone_screen_one_content() on my page

    The invitation screen is displaying properly, but when I submit the form, no invitations are getting sent, and the %%inviter%% variables aren’t getting replaced with the proper text. The “From your address book” link doesn’t work. I’m not seeing any JS or PHP errors.

    Before I get too much farther with trying to get this to work, I thought I would check with you to see whether you think this is at all feasible, and whether my approach so far is sensible. Will displaying this form on another page require totally rewriting the plugin? Do you have any advice before I proceed? (I will consider “You shouldn’t try to do this” good advice, if you think that’s the case.)

    https://www.ads-software.com/plugins/invite-anyone/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Boone Gorges

    (@boonebgorges)

    The plugin isn’t designed to be quite this modular. So there’s a bunch of work to be done. That said, it *can* be done. Off the top of my head:

    – You’ve said you’ve already enqueued the necessary CSS and JS, but the “From your address book” makes me think that you’ve missed at least some. Checkout the by-email/cloudsponge files.
    – You’ll have to reproduce the logic for catching form submits. Here’s my logic, which assumes that you’re on the send-invites page: https://github.com/boonebgorges/invite-anyone/blob/1.3.x/by-email/by-email.php#L382. This is the bare minimum you’ll need to do to get invitations to send.
    – It’s likely that there are references throughout to bp_displayed_user_id() and other displayed_user stuff. If you’re putting the form on a different page – one that’s not under a example.com/members/foo/ URL – you’ll need to rewrite some of this to explicitly specify the sender’s user ID.

    Hope that’s a helpful start! Good luck.

    Thread Starter Morgan Kay

    (@gwendydd)

    That definitely helps! I will keep at it, and let you know if I run into other questions.

    Hi Morgan, I’m working on the same task just now and I wonder whether you can share you solution. I will be very thankful for your help.

    Thread Starter Morgan Kay

    (@gwendydd)

    Hi, madWPua!

    I ended up giving up on this – it got way too complicated, and was going to push the project way over budget.

    Sorry I can’t be more helpful!

    Ok. Thanks for such fast reply ))) I hope I’ll be more lucky because I have no other chances )))

    I’m also looking for a solution to this so I can simply have a “Send Invites” page. If anyone has figured this out yet, please let me know. thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Send invitations from another page’ is closed to new replies.