Small Pommo Integration

This plugin is discontinued
…due to not using it anymore myself since over a year.. feel free to use it, though.

This Plugin brings Pommo and WordPress togther. You can feed your Pommo newsletter with a subscription formular from your wordpress website.

  • Subscription formular is build from wordpress fields.
  • Supports an AJAX and a “normal” subscription formular
  • Highligy customizable: Each and every label and message could be defined, all Pommo fields can be either shown, not shown (=Pommo defaults) or provided hidden with custom defaults.

Installation

Either:

  • Download .zip file and extract into your “wp-content/plugins” directory.

or

  • Use the WordPress installer to install the plugin

Then

  • Activate the plugin through the ‘Plugins’ menu in WordPress
  • o to Settings -> Pommo and configure your database connection to Pommo!
  • To place the subscribe formular simply put the shortcode [pommo-formular] for the “regular” formular (or [pommo-ajax-formular] for the ajax driven) in the WordPress editor (there are two, you can use any of those) .. You could also call the formular creation directly in a template via spi_print_pommo_form() or spi_print_pommo_ajax_form()

If you want to use the AJAX Form

  • Dont use any Success URL or Confirm URL in Pommo ( Setup -> Configure -> General ) !! This would throw a redirect which cant be handled! Leave it blank!

Frequently Asked Questions

The Message from the AJAX Form is always “Error..”! Why ?
Probably because you have modified the Pommo success / error templates. This is not forbidden, but it’s mandatory that there is the div with the id “alertmsg” ..

It looks like this : <div id=”alertmsg” class=”error”>Why there is an error</div> or on success: <div id=”alertmsg”>Welcome ..</div>

This is required! Dont remove it! But you can hide it (style=”display:none”) if you want.. the “class=error” is also required!

I’ve used a Site URL and removed it because i want the AJAX Formular – and it still doesnt work !
Also remove the “Confirm URL” in Setup -> Configure -> General

I HAVE to have a Success and / or Confirm URL but i still want the AJAX Formular !
You could replace the process.php in “path-to/pommo/user/process.php” with the one provided in this plugin .. But no warranties! If the Pommo developers will make any changes or some!

With which version of Pommo does this work ?
I’ve tested 16.1, the current stable in 2009-04.

I have a problem with pommo, it wont work
Please go here: http://pommo.org and ask the developers.

Why cant i setup new fields for Pommo from WordPress ?
Because the Pommo developers kindly provided this feature in Pommo.

Screenshots

Download

small-pommo-integration-0.5

Changenotes

  • 2009-09-16 : Sort order of the fields as in pommo preset and not alphabetic

26 Comments

  1. baron says:

    Works great, thank you

  2. WordPress 2.7.1. No idea to:
    “OOops! No Fields found ?! Either you really have not created any field or your “Database Table Prefix” (above) is incorrect ?”

    The Prefix doesnt matter. But CREATED ANY FIELD? What means that?
    Please be very clear.

    Thank you.

  3. admin says:

    This error messages pops up if either the plugin cannot access your database-table to read the subscriber fields (because it has the wrong table prefix..) or you really havent created any.

    The “any field” refers to the “Pommo subscriber fields”. Log in to Pommo as admin, go to Setup > Fields. Here you can add custom fields for your subscribers.

    But again: the fields are *not* mandatory to use the plugin. If you just want an “Email-Input + Signup-Button”-Formular, just ignore it.

    Hope it helps.

    UK

  4. Olli says:

    Habe das Plugin gerade auch mal ausprobiert. Installation klappt soweit, ich kann auch die verschiedenen Felder sehen und deren Sichtbarkeit ändern, aber: Input-Felder vom Typ “Text” werden bei mir gar nicht angezeigt (nur das Label); Input-Felder vom Typ “Zahl” werden zwar angezeigt, im Input-Feld steht aber “/> <span class=”. Scheinbar fehlt hier im Quelltext das schließende Anführungszeichen beim Value-Tag. Mehrfachauswahl scheint zu funktionieren, den Rest habe ich nicht getestet.

    Sende ich das Formular ab, werde ich auf die entsprechende Fehler-Seite von Pommo weitergeleitet, leider keine Spur von AJAX trotz [pommo-ajax-formular]. Mit [pommo-formular] funktionierte es übrigens überhaupt nicht – WordPress interpretierte den Platzhalter erst gar nicht.

    Wie ich den Kommentaren entnehmen kann, funktioniert es ja zumindest bei einem. Könnte es an Plugin-Inkompatibilitäten liegen? Habe natürlich auch einige AJAX-Plugins installiert …

    Gruß & Lob für die nichtsdestotrotz tolle Arbeit,
    Olli

  5. uk says:

    Hallo

    Ok, habe da ein ” wohl übersehen ;) Vielen Dank fürs aufmerksam machen. Habe Version 0.2 ins SVN gespielt. Bitte einfach upgraden, dann sollte es mit Text-Feldern funktionieren.

    Die Weiterleitung zum Pommo könnte vielleicht daran liegen dass in “Confirmation URL” oder “Success URL” in Pommo (Setup -> Configure -> General) noch was drin steht. Wenn das der Fall ist dann bitte komplett leeren. Falls das unbedingt benötigt wird (zB falls man Pommo noch über ein anderes Formular als das hier genierte füttern möchte) dann muss die orginal “pommo/user/process.php”-Datei durch die (im Plugin) mitglieferte “process.php” ersetzt werden ..

    Gruß UK

  6. Olli says:

    Danke für deine schnelle Hilfe! Textfelder funktionieren jetzt und im Prinzip läuft das Plugin auch.

    Nichtsdestotrotz funktioniert weiterhin AJAX nicht (richtig), siehe: http://www.buergerstadt-bornheim.de/newsletter

    Ich habe das Formular dort einmal per [pommo-formular] und darunter per [pommo-ajax-formular] eingebunden. Wenn du beim AJAX-Formular auf “Abonnieren” klickst, kommt zwar ein AJAX-Effekt. Die Fehler- oder Bestätigungsseite wird aber dennoch in einem neuen Fenster geöffnet. Und ja, die beiden von dir angesprochenen Felder in den Pommo-Einstellungen sind leer. Ich habe mal probeweise alle in Frage kommenden Plugins bei mir deaktiviert und der Fehler trat weiter auf.

    Auf der Seite siehst du auch noch einen zweiten Fehler: Ein in die Seite mit dem Formular eingebundener Text wird IMMER unter dem Formular dargestellt, und zwar in verkehrter Reihenfolge :)

    Aber trotzdem: Gute Arbeit, das Plugin erleichtert das Einbinden schon enorm!

    Gruß,
    Olli

  7. uk says:

    Ok, habe mir die Seite mal angesehen.

    Zur Positionierung: Nutze den Shortcode selber nicht, habe nur getestet ob er ausgegeben wird, dabei muss ich wohl übersehen haben, dass die Positionierung nicht eingehalten wird .. Jetzt klappts (update auf v0.3).

    Denke nicht, dass das an WordPress Plugins liegt. Pommo schickt einen “Location”-Header mit, der dazu führt, dass auf eine andere Seite weitergeleitet wird. Bei dir muss das wohl irgend eine verteckte Pommo Interna sein. Ich hab hier Version PR16.1, damit klappt es wenn ich die genannten URLs leer lasse (zumindest bei zwei getesteten Installtionen), aber vielleicht gibt es noch irgend eine andere Einstellung die diesen Redirect auslöst (habe auf die schnelle nichts gefunden..).
    Die im Plugin enthaltene process.php (ersetzen gegen die im Pommo unterverzeichnis user/process.php..) sollte das beheben. Einfach überkopieren, aber keine Garantie, dass das nicht zu Problemen führt sollte Pommo tatsächlich mal upgradet wird!

    Gruß
    UK

  8. Olli says:

    Die Positionierung funktioniert jetzt, dafür sind die Textfelder wieder verschwunden :)

    AJAX habe ich nach wie vor nicht ans Laufen bekommen – wenn du sagst, dass es bei dir läuft, liegt der Fehler wohl irgendwo bei mir (habe mir Pommo selber erst vor wenigen Tagen besorgt, ergo ebenfalls die neueste Version) – der Austausch der process.php brachte ebenfalls keine Besserung.

    Na ja, werde jetzt einfach die Non-AJAX-Version nutzen und mir meine eigene jQuery-Validierung einbauen. Nichtsdestotrotz wäre es schön, wenn die Textfelder wieder funktionieren würden :)

    In Erwartung von Version 0.4,
    Olli

  9. Olli says:

    In Urlaub oder keine Lust mehr? :)

  10. Joachim says:

    Hallo,

    sehr geiles Plugin. Funzt prima. Es sollte nur noch widgetready sein :-)

    Grüße
    Joachim

  11. Ben says:

    I’m having trouble getting the non ajax form to show fields correctly using the short-code in a page. It will show the title of the extra fields but not the part of the form where data is entered.

  12. George says:

    Hi,
    I have your plugin installed on a client site, and have a multiple choice field in pommo.

    I have created a page using the ajax formtter, and the multiple choice filed is shown there only there is no dropdown box so that is can be set.

    What do I need to do to get the field choices displayed on the wordpress page?

    Thanks

  13. charlie says:

    Hi Ulrich

    im not a pro but I try to fix my website but i have a litle problem i would like to shou on my template sidebar your subscribe plugin (small pommo) but because I dont kmow programation, I would like if you can help me with the correct program line.
    I have tryed this but dont work?

    thankyou for your help
    charlie

  14. charlie says:

    ho there is the code

    ()

  15. charlie says:

    ?php spi_print_pommo_ajax_form()

  16. uk says:

    Ok everyone, sorry, have’nt had any time at all. Have just uploaded 0.4 with some fixes concerning additional fields (they simply werent shown at all..). Should work now, get back to me if it doesnt!

    @charlie: I’m not quite sure if if understand you correctly. You might try: < ?php echo spi_print_pommo_ajax_form() ?> or < ?php echo spi_print_pommo_form() ?>, this should do, i use it myself.

  17. m.a. says:

    Cooles Plugin, aber zwei Korrekturen die ich bei mir lokal angebracht habe:

    In includes.php, Zeile 92, habe ich den SQL Aufruf geändert in:

    $fields = $db->get_results( $s = sprintf( ‘SELECT * FROM `%sfields` ORDER BY `field_ordering` ASC’, $options[ 'spi_table_prefix' ] ), OBJECT );

    Damit bleibt die Reihenfolge der Felder erhalten, wie sie in Pommo eingestellt sind.

    Und dann in frontend-gui.php, Zeile 151:

    ‘. $field->field_prompt. ‘

    Da ich persönlich es sinnvoller Finde, wenn die Feldbeschreibungen im Labeltag stehen, anstelle der (meist doch recht willkürlichen) Feldnamen. Deswegen habe ich dann auch alle Ausgaben im Stil

    ‘. $field->field_prompt. ‘

    entfernt.

  18. Charlie says:

    Hi Ulrich

    Thank you for your prompt answer, yes they work but the problem was the space between ( < ? ) on beginig of the code insted must be ( <? )

    this code work

    this code not work

    in my template…

    Thank you for your very good plugin…
    Best Regards
    Charlie

  19. Shibly says:

    Something went wrong. (UNKNOWN)
    I get this error message. Do i need to define the fields cant I keep it as default. But if i define a field i get the same error

  20. uk says:

    The UNKNOWN error is provided if the response of pommo (where this plugin will send the formular data) is unparseable.. Probably you have either not pommo installed correctly or you’ve modified the default response template from pommo.. If so, please look in the attached readme under “The Message from the AJAX Form is always “Error..”…” If not, try to use the non-AJAX formular, maybe you get more errors there.

  21. Rembert Oldenboom says:

    Subscription forms (non ajax) with checkboxes weren’t accepted.
    Fix below

    Changed frontend-gui.php at line 163:

    OLD:
    field_id. ‘]” id=”‘. $id_prefix. ‘field’. $field->field_id. ‘” value=”1″ />

    NEW:
    field_id. ‘]” id=”‘. $id_prefix. ‘field’. $field->field_id. ‘” checked=”checked” />

    Still having problems with the ajax version, with UNKNOWN error (pommo installed out of the box, having empty response templates). Trying to solve this one too.

  22. Rembert Oldenboom says:

    Didn’t manage to tackle the UNKNOWN error. Subscription requests are written to the pommo database and the process.php script is processing everything well. It seems to be a problem with ajax interpreting the results. Tried to go back from Dutch to English in Pommo. Didn’t solve the problem. So I’m a bit lost for now.

  23. uk says:

    Hmm, it’s not that easy to debug this from here ;) .. please try the following:

    in frontend-gui.php line 94:
    —-
    success: function( result ) {
    result = jQuery( \’#alertmsg\’, result ), data = { success: false, message: \’UNKNOWN\’ };
    —-

    replace with:
    —-
    success: function( result ) {
    alert( “RESULT: “+ result );
    result = jQuery( \’#alertmsg\’, result ), data = { success: false, message: \’UNKNOWN\’ };
    —-

    and then copy & paste the result and mail it to me.

  24. George says:

    Thanks works great.

    .05 download from web site arppears to be empty.

    also in .04 frontend-gui.php seems to output a label using the pommo field prompt, and then again the same fiend is output in a span class=”"spi-field-comment” so that you end up with the field prompt appearing twice. This can be overridden in css using display:none.

  25. neaz says:

    You said that “You could also call the formular creation directly in a template via spi_print_pommo_form()” I couldn’t figure this out? Where shall I put spi_print_pommo_form() in functions.php or Page.php?????

    Will you plz elaborate a bit?

  26. uk says:

    @neaz: Of course.
    You have to edit an existing wordpress template (eg index.php in your theme folder) or create a new one. There you can print the signup formular for pommo via:
    <?php echo spi_print_pommo_form(); ?>

Leave a Reply

CAPTCHA image