WordPress.org

Ready to get started?Download WordPress

Forums

MailPoet Newsletters
[resolved] [Plugin: Wysija Newsletters] How do I insert the form without using widget? (25 posts)

  1. kaled.m
    Member
    Posted 2 years ago #

    How do I insert the form without using widget?

    I'm not using widgets, and I'm struggling to add the form on my website.

    Thank you!

    http://wordpress.org/extend/plugins/wysija-newsletters/

  2. Ben
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Kaled,

    We recommend our users to use widgets for ease of use.
    Nevertheless if you want to insert the form without using widget, here is the solution:

    $widgetdata=array(
        'widget_id' => 'wysija-nl-php-1', //form identifier important when many subscription forms on the same page
        'lists' => array ( 0 => '4', ), //array of list_id to which you want to subscribe your users
        'submit' => 'Subscribe!', //name of the subscribe button
        'success' => 'You\'ve successfully subscribed. Check your inbox now to confirm your subscription.'//success message returned when registered
            );
    
    $widgetNL=new WYSIJA_NL_Widget(1);
    $subscriptionForm= $widgetNL->widget($widgetdata,$widgetdata); 
    
    echo $subscriptionForm;

    That should do the trick :)
    Let me know!

    Cheers,

    Ben

  3. kaled.m
    Member
    Posted 2 years ago #

    Niiiiiiiice !!

    It worked. Very good!

    Muito obrigado !! =D

  4. Ben
    Member
    Plugin Author

    Posted 2 years ago #

    hehe cool :)

    Seja bem-vindo !

  5. haleinad
    Member
    Posted 2 years ago #

    Sorry but... Is the first time that i use WP! And sorry for my english... Where i must copy this code? I have a website made with a free template. I want put this plugin inside a page called Newsletter, i have copy this code inside a form, but it doesn't work, i see only the text:

    $widgetdata=array(
    'widget_id' => 'wysija-nl-php-1', //form identifier important when many subscription forms on the same page

    Etc... Etc...
    Thanks
    D.

  6. Ben
    Member
    Plugin Author

    Posted 2 years ago #

    We have very simple and automated ways to do things in Wysija.
    Coding is not necessary !

    If you want to add the subscription form in a page or post. Please do not use this php code.

    Instead, from the text editor of your page/post follow the tutorial here:
    http://support.wysija.com/knowledgebase/add-a-subscription-form-to-an-article-or-page/.

    Cheers,

    Ben

  7. haleinad
    Member
    Posted 2 years ago #

    Thanks! now it works! but i have a problem... first i insert the form inside my page, then i put my email address, but when i click on "subscribe" doesn't appear the message "You've successfully subscribed....." but only this code: "YTo0OntzOjk6IndpZGdldF9pZCI7czoyMDoid3lzaWphLW5sLTEz etc...."

    bye bye

  8. Ben
    Member
    Plugin Author

    Posted 2 years ago #

    Strange !

    I don't have the same problem on my end.
    Can you come to our support site to post a ticket so that we can solve that bug together?

    http://support.wysija.com

    Thanks

    Ben

  9. haleinad
    Member
    Posted 2 years ago #

    i don't know, because if i look the html code of the page, i see this: (that is the form)

     
    [Code moderated as per the Forum Rules. Please use the pastebin]
     

    the problem is when i click on subscribe that appear only "YTo0OntzOjk6IndpZGdldF9pZCI7czoyMDoid3......"

    I tried to replace this code "YTo0OntzOjk6IndpZGdldF9pZCI7czoyMDoid3......" with this text: "Thanks, now check your email..."

    but when i connect to the page , i see up to the form this code:
    Warning: extract() [function.extract]: First argument should be an array in /htdocs/public/www/wp-content/plugins/wysija-newsletters/core/base.php on line 2

    Thanks for everythings

  10. Ben
    Member
    Plugin Author

    Posted 2 years ago #

    Yes you cannot modify that code, this is meant not to be touched :)
    It is a base64 encoded string of a serialized array.
    It contains the data describing the subscription form.

    My guess is that there is a javascript conflict on your site.
    Can you give me the address of your site so that I can have a look?

    Ben

  11. haleinad
    Member
    Posted 2 years ago #

    yes... but can i send you the website in a private address? not so public...

  12. Ben
    Member
    Plugin Author

    Posted 2 years ago #

    yes sure ! come to our support website and let's finish our conversation there :)

    http://support.wysija.com

  13. Ben
    Member
    Plugin Author

    Posted 2 years ago #

    from haleinad:

    Ben, thanks! I’ve found the problem :) (read on your website...) There was a conflit with different plug-in!
    Have a nice day!

    I hope she will tell us which plugins is entering in conflict with us.
    :)

    By the way we have just committed a change that might solve a lot of conflicts with other plugins.
    Actually we removed a line which was intended to suppress a conflict with a particular plugin. This precise line was creating even more conflict with other plugins :/

    I realised that a lot of plugins tend to include their own javascript on backend pages where they don't belong. For instance wysija's interfaces :x

    I hope we could change this bad habit, but it sounds like a fight we cannot win :(

  14. Oelita
    Member
    Posted 2 years ago #

    Hello,
    I've got the same probleme with the new "newsletter" page I just created with your form inside. A token is displayed when sending an e-mail to subscribe.
    The site is private so I can't give you the url, but I can see that the following plugin javascripts are on that page : contact form 7, and wp-postratings.
    Thanks in advance for help

  15. Ben
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Oelita,

    I'm not sure I understand the issue that there is with your site.
    I've tried the latest version of contact form 7 and wp-postratings with wysija and our visual editor works fine with it.

    Anyway come to http://support.wysija.com and post a support ticket we will be able to exchange private information from there.

    See you there!

    Cheers,
    Ben

  16. Oelita
    Member
    Posted 2 years ago #

    There is no probleme with the visual editor, only with the form you generate in my page, to subscribe.

    I quote the former message from haleinad :

    "first i insert the form inside my page, then i put my email address, but when i click on "subscribe" doesn't appear the message "You've successfully subscribed....." but only this code: "YTo0OntzOjk6IndpZGdldF9pZCI7czoyMDoid3lzaWphLW5sLTEz etc...."

    I have the same problem. And as the solution was "conflict with different plug-in!", I'm looking for that.

    I'm creating a support ticket, anyway :-)

  17. Oelita
    Member
    Posted 2 years ago #

    Problem solved with the new 1.1.3 version, thanks.

  18. Ben
    Member
    Plugin Author

    Posted 2 years ago #

    glad to hear that. :)

  19. MailPoet Staff
    Member
    Plugin Author

    Posted 2 years ago #

    Note that there will also be an iframe version of the form available from the widget. Practical to design and paste anywhere, even on another site.

    Preview: https://img.skitch.com/20120605-bigctefhtwdrka1rsr9ww3g6c7.png

  20. minddog1
    Member
    Posted 2 years ago #

    is there any way to get that submit button on the same line, not below?

  21. Kim Gjerstad
    Member
    Plugin Contributor

    Posted 2 years ago #

    Yes! There's a tip at the end of this post:

    http://support.wysija.com/knowledgebase/design-style-subscription-form-widget-shortcode/

    Tip: next time open a new issue. Otherwise, you'll find plenty of doc for our plugin on our support site.

  22. prakashchhetri
    Member
    Posted 1 year ago #

    I have a problem.. I have a custom theme and I want to include the form in my page but with only the email field. How can i do so?

  23. MailPoet Staff
    Member
    Plugin Author

    Posted 1 year ago #

  24. prakashchhetri
    Member
    Posted 1 year ago #

    It is only possible if I have sidebars in my theme . But my theme is created in such a way that there are no sidebars and i want to include the option to subscribe in the footer of my website.

    I used this code

    <form id="form-wysija-nl-php-1" method="post" action="#wysija" class="widget_wysija form-valid-sub">
    
    <p class="wysija-instruct">To subscribe to our newsletter simply add your email.</p>
    
    <span class="wysija-p-email abs-req"><input defaultvalue="" id="form-wysija-nl-php-1-abs-email" value="" class="defaultlabels validated[abs][email]" name="wysija[user][abs][email]" type="text"></span>
    
    <input class="wysija-submit wysija-submit-field" name="submit" value="Subscribe" type="submit"></p><input name="formid" value="form-wysija-nl-php-1" type="hidden">
                        <input name="action" value="save" type="hidden">
                    <input name="wysija[user_list][list_ids]" value="1" type="hidden">
                    <input name="message_success" value="You’ve successfully subscribed. Check your inbox now to confirm your subscription." type="hidden">
                    <input name="controller" value="subscribers" type="hidden"><input id="_wpnonce" name="_wpnonce" value="42e8b920d8" type="hidden"><input name="_wp_http_referer" value="/new_home/" type="hidden"><input value="1" name="wysija-page" type="hidden"><input value="9787924692" id="wysijax" type="hidden"></form>

    but it is displaying "Security failure during request. " message

  25. amistad18
    Member
    Posted 1 year ago #

    @prakashchhetri > can't you just register a sidebar (don't mention to use it), on Appearance > Widgets add Wysija Subscription widget, configure it, and just get iframe or php code from there? You don't need to display this sidebar on your site, but it is much easier to get code by widget.

    http://support.wysija.com/knowledgebase/insert-a-subscription-form-with-php-without-a-widget/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic