WordPress.org

Forums

Fast Secure Contact Form
autofill recipients on multisites (13 posts)

  1. stephanepage
    Member
    Posted 2 years ago #

    What is the code to automatically grab the webmaster or administrator's email in the recipient field?

    This is for multisites. I want to create multisites without having to manually update the recipient's field each time.

    Thank you,

    Stephane

    http://wordpress.org/extend/plugins/si-contact-form/

  2. Mike Challis
    Member
    Plugin Author

    Posted 2 years ago #

    This plugin uses get_option('admin_email') to find the admin email.
    line 1882 of si-contact-form.php
    I do not know enough about multi-site to know what to change to pick the right email for all your sites.
    How did you install the plugin? it network activated?

    If anybody has suggestions I would like to know.

  3. Mike Challis
    Member
    Plugin Author

    Posted 2 years ago #

    This might work. Are you handy enough to test it?
    You may have to delete the plugin and allow it to delete the data.
    Then, FTP upload the entire /si-contact-form/ plugin folder with this modified file before you activate it again.

    edit si-contact-form.php around line 1879

    change

    $si_contact_option_defaults = array(
             'form_name' => '',
             'welcome' => __('<p>Comments or questions are welcome.</p>', 'si-contact-form'),
             'email_to' => __('Webmaster', 'si-contact-form').','.get_option('admin_email'),

    to

    if (function_exists('is_multisite') && is_multisite()) {
             $admin_email = get_site_option( 'admin_email' );
    } else {
             $admin_email = get_option('admin_email');
    }
         $si_contact_option_defaults = array(
             'form_name' => '',
             'welcome' => __('<p>Comments or questions are welcome.</p>', 'si-contact-form'),
             'email_to' => __('Webmaster', 'si-contact-form').','.$admin_email,
  4. stephanepage
    Member
    Posted 2 years ago #

    I don't seem to be handy enough. I changed it the way you suggested but it keeps showing me the old code.

    Could I hire you to do it?

  5. stephanepage
    Member
    Posted 2 years ago #

    Could I hire you to do it?

  6. Mike Challis
    Member
    Plugin Author

    Posted 2 years ago #

    When I researched this I discovered I do not need to add this code because the form grabs the get_option('admin_email') which is the administrator of each individual site.

    get_site_option( 'admin_email' ) is the administrator of all the sites.

    So what one do you need? and if it is site "administrator of all the sites" that you need, please explain why each site does not have the correct admin set that you want. I am confused why the individual blog site admin is not the desired recipient.

  7. stephanepage
    Member
    Posted 2 years ago #

    What do I have to type in that field in order to trigger the Administration email as the one who receives the form data?

    Is it Webmaster? admin_email? Administrator?

    It was written in that field by default Webmaster but it doesn't seem to send to the administrator.

    My goal is that each child-site owner receives the data.

    Thank you Mike!

  8. stephanepage
    Member
    Posted 2 years ago #

    The administrator of each individual sites IS the recipient.

    I put admin_email in the recipient like this but nothing sends to that recipient and I also get an error message: http://screencast.com/t/ZCPRihef3xsN

    But from re-reading your message, I think I need to put get_option('admin_email')

    But when I do, I get this error message again: http://screencast.com/t/tlhUjM8h

  9. Mike Challis
    Member
    Plugin Author

    Posted 2 years ago #

    On the form edit page, you cannot add PHP code into the settings. The setting you are having errors with expects an email address.

  10. stephanepage
    Member
    Posted 2 years ago #

    How do I do this then?

    Is there a solution?

    I need to have the same information as this site replicates across multiple sites. I can't create a form for each individual site, it would be too long. That'S why the form replicates across all site and need to pick the administrator of each individual site as the recipient.

    Thanks for your help.

  11. stephanepage
    Member
    Posted 2 years ago #

    You said "the form grabs the get_option('admin_email') which is the administrator of each individual site."

    How do I type this in the form recipient so that it automatically send the form results to the administrator of each site without me having to add their email address in the form plugin?

  12. Handoko
    Member
    Posted 2 years ago #

  13. jrobe
    Member
    Posted 1 year ago #

    Hello stephanepage!

    I was reading up and looking around the forums and I found that you were looking for a way to all sites on a multi-site setup with a few changes per site owned by sally, chris, etc.

    I noticed that you solved this and are automatically updating all the content!!
    How did you manage this!! I need to do this for a client of mine, and I only can find the replicator and only doing it for brand new sites.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags