Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#301 2007-07-26 11:33:06
Re: [archived] Postmaster -- A simple email-on-post / newsletter manager
When using the
<txp:bab_pm_data display=“link” />
I dont get the clean nice looking URL but a URL with ? in it. Is there a way to work around this?
Offline
#302 2007-07-26 15:51:40
Re: [archived] Postmaster -- A simple email-on-post / newsletter manager
Gemal,
There is a tip here from Psilo that might be of use to you. You’ll have to hack a bit, I’m afraid. The relevant code is in Postmaster_library, and it looks like this:
// ---- article-related
if ($display == 'link') {
if (!$artID) { return; } else {
$link = "<txp:site_url />index.php?id=$artID";
return $parsed_link;
}
}
You’ll want to build the link differently than it’s doing now.
- Ben
Last edited by benbruce (2007-07-26 15:56:41)
Offline
#303 2007-07-28 00:15:08
Re: [archived] Postmaster -- A simple email-on-post / newsletter manager
>Ben
Thanks again for this wonderful plugin.
I like to keep track of First and Last names separately using custom fields. I have some redundant info, but it’s more flexible.
Problem is, on the ZCR signup form, I don’t want to ask people to put in their both their fullnames (zemSubscriberName) and their given and last names (ZemSubscriberCustom1/2).
Is there any other way around this scenario, Is there a way to automagically populate the full name from the split name?
Thanks.
Offline
#304 2007-07-28 04:21:50
Re: [archived] Postmaster -- A simple email-on-post / newsletter manager
mrdale,
You’re very welcome.
:)
Now let’s get your hands dirty.
There is a hack that almost does what you want, but doesn’t. But it shouldn’t be too hard to do in the Postmaster code, I think — try something like this (assuming you are using custom field 1 and custom field 2 for first and last names):
At around line 820 in Postmaster plugin, underneath the following code …
//---- otherwise, define all other variables, and enter data into postmaster
$bab_pm_zemSubscriberName = doSlash(ps(‘zemSubscriberName’)); $bab_pm_zemSubscriberLists = doSlash(ps(‘zemSubscriberLists’)); $bab_pm_zemSubscriberCustom1 = doSlash(ps(‘zemSubscriberCustom1’)); $bab_pm_zemSubscriberCustom2 = doSlash(ps(‘zemSubscriberCustom2’)); $bab_pm_zemSubscriberCustom3 = doSlash(ps(‘zemSubscriberCustom3’)); $bab_pm_zemSubscriberCustom4 = doSlash(ps(‘zemSubscriberCustom4’)); $bab_pm_zemSubscriberCustom5 = doSlash(ps(‘zemSubscriberCustom5’)); $bab_pm_zemSubscriberCustom6 = doSlash(ps(‘zemSubscriberCustom6’)); $bab_pm_zemSubscriberCustom7 = doSlash(ps(‘zemSubscriberCustom7’)); $bab_pm_zemSubscriberCustom8 = doSlash(ps(‘zemSubscriberCustom8’)); $bab_pm_zemSubscriberCustom9 = doSlash(ps(‘zemSubscriberCustom9’)); $bab_pm_zemSubscriberCustom10 = doSlash(ps(‘zemSubscriberCustom10’));
… add the following hack …
/* hack to combine first and last name inputs into single zemSubscriberName field */
$bab_pm_zemSubscriberName = $bab_pm_zemSubscriberCustom1 . ' ' . $bab_pm_zemSubscriberCustom2;
… and finally, update your subscription form to have no subscriber name input (only the custom 1 and custom 2 inputs, where you’re asking for first and last name.
See how that works and let me know.
* BenLast edited by benbruce (2007-07-28 04:22:33)
Offline
#305 2007-07-28 16:59:02
Re: [archived] Postmaster -- A simple email-on-post / newsletter manager
Worked right out of the box. no mods… no nothin’.
Damn, I love it when stuff works.
Word, y’all. bb’s da man. Dig?
Last edited by mrdale (2007-07-28 16:59:50)
Offline
#306 2007-07-28 19:12:29
Re: [archived] Postmaster -- A simple email-on-post / newsletter manager
Ben – this is a great plugin but I can’t get it to work. It sends out emails alright but I have trouble getting subscribers in the database.
I want to use two lists and I want a subscription form that simply has a name, an email field , the dropdown for the list and a submit button.
This is what I tried (without luck):
<txp:zem_contact to="my@email.com" >
<txp:zem_contact_text name="zemSubscriberName" label="Your Name:" />
<txp:zem_contact_email name="zemSubscriberEmail" label="Your Email:" />
<txp:zem_contact_select list="List A,List B" selected="List A" name="zemSubscriberLists" label="Your List:" />
<txp:zem_contact_submit />
</txp:zem_contact>
I understand that there should be the name="zemDoSubscribe"
attribute but I have no idea where to put it. I don’t want another dropdown list with “subscribe” / “no” in it. Or is this unavoidable?
I’d appreciate if you could get me on track here. Thanks in advance.
Last edited by andreas (2007-07-28 19:12:44)
Offline
#307 2007-07-29 17:19:45
Re: [archived] Postmaster -- A simple email-on-post / newsletter manager
andreas, you don’t need to have the name="zemDoSubscribe"
bit if you don’t want it. The code you pasted should work; the only thing I noticed was no opening <txp:zem_contact>
tag. So the full snippet of code should be:
<txp:zem_contact>
<txp:zem_contact to="my@email.com" >
<txp:zem_contact_text name="zemSubscriberName" label="Your Name:" />
<txp:zem_contact_email name="zemSubscriberEmail" label="Your Email:" />
<txp:zem_contact_select list="List A,List B" selected="List A" name="zemSubscriberLists" label="Your List:" />
<txp:zem_contact_submit />
</txp:zem_contact>
Is that actually what you have? If not, that’s your problem. If so, keep trying variations because what you want should not be too difficult to do. I’ll put some more thought into it when I have more time.
- Ben
Offline
#308 2007-07-29 18:06:50
Re: [archived] Postmaster -- A simple email-on-post / newsletter manager
Thanks Ben – it doesn’t work, though.
I’m not sure about the opening tag zem_contact because it would be double in your version (I use zem_contact_reborn on another site and I don’t have a douple opening tag there).
When I add it (without the “to” attribute as in your version) the plugin returns an error message saying that the “to” address is missing.
Perhaps I misunderstand what the form should be doing: What I expect is that when I submit the form, the new subscriber should turn up in the subscribers list of postmaster, right?
Here’s the snippet I tried (with variations but without luck).
<txp:zem_contact to="my@gmail.com">
<txp:zem_contact_text name="zemSubscriberName" label="Your Name:" />
<txp:zem_contact_email name="zemSubscriberEmail" label="Your Email:" />
<txp:zem_contact_select list="KGN-Neuigkeiten,Nur-Schulrundbrief" selected="KGN-Neuigkeiten" name="zemSubscriberLists" label="Your List:" />
<txp:zem_contact_submit />
</txp:zem_contact>
The two lists appear in the real names now. Are there any restrictions on these names (no spaces, no non-ascii characters etc.?).
What exactly does the name="zemDoSubscribe"
attribute do?
Thanks for any further help.
Last edited by andreas (2007-07-29 18:13:45)
Offline
#309 2007-07-29 21:38:19
Re: [archived] Postmaster -- A simple email-on-post / newsletter manager
andreas,
I was confused. Sorry — you’re right, there should only be ONE opening tag.
The zemDoSubscribe
attribute is used only if you want a form that can do either (ie, contact or subscribe). You don’t need it, though.
I suggest trying the example form from the Postmanual and seeing if that works. Once you know the system is working properly, tweak the form to do what you want.
There is a comment here about using ampersand in the list field. Otherwise, I don’t know of any restrictions.
- Ben
Offline
#310 2007-07-30 07:40:12
Re: [archived] Postmaster -- A simple email-on-post / newsletter manager
Ben, it doesn’t work with the default form. I changed it very little (removing the custom field and changing my email address) and nothing happens on the DB side when I submit it.
To be sure, this is the code:
<txp:zem_contact to="my@gmail.com" >
<txp:zem_contact_text name="zemSubscriberName" label="Your Name:" />
<txp:zem_contact_email name="zemSubscriberEmail" label="Your Email:" />
<txp:zem_contact_select list="default,test" selected="default" name="zemSubscriberLists" label="Your List:" />
<txp:zem_contact_checkbox label="This is not Spam. " />
<txp:zem_contact_submit /> </txp:zem_contact>
By the way, from the postmanual, I was expecting this form to be a “manual” subscription solution in which I had to enter subscribers by hand once they notified me via email of their wish to subscribe. Because in the manual it says:
this form will:
Send a subscription notice (ie, an email that so-and-so subscribed) to whatever email address you enter
Display fields for Subscriber Name, Email, and Favorite Color, a dropdown choice for what list to subscribe to, and a checkbox that is required as an anti-spam method.
Whereas for the combined contact/subscription form it says explicitly:
If the user leaves the dropdown on “Subscribe,” their email address and name will be entered into the database. If they select “No,” then just the contact form will be sent (and they won’t be subscribed).
It thought this difference was significant — but it seems it isn’t, is it?
Any other ideas as to what the problem might be?
Last edited by andreas (2007-07-30 07:41:34)
Offline
#311 2007-07-30 16:17:03
Re: [archived] Postmaster -- A simple email-on-post / newsletter manager
It should read:
Send a subscription notice (ie, an email that so-and-so subscribed) to whatever email address you enter into the database. In other words, no it’s not manual — the subscribers will be entering themselves into the database.
I’m really not sure what the problem is — it sounds like there might be an issue besides the form, but I really can’t tell from here.
- Have you been through the tutorial ?
- Have you correctly set the admin email and created the lists you want in there?
- When you go to the TXP > Extensions > Postmaster > Subscribers tab, do you see an email in there? I want to make sure the tables were created and that you CAN subscribe to them.
- What happens if you just copy and paste the example form, change the
to
address, and test it?
- Ben
Offline
#312 2007-07-30 17:03:59
Re: [archived] Postmaster -- A simple email-on-post / newsletter manager
Have you been through the tutorial ?
I have.
Have you correctly set the admin email and created the lists you want in there?
Yes.
When you go to the TXP > Extensions > Postmaster > Subscribers tab, do you see an email in there? I want to make sure the tables were created and that you CAN subscribe to them.
I can. I do see the default list and the test subscriber. It also works when I enter a subscriber manually – I have already sent text mails using my own newsletter form. All workes find except the automatic subscription.
What happens if you just copy and paste the example form, change the to address, and test it?
I get an email to my admin address with the contents of the form. But in the DB nothing happens. The subscribers list remains as it was at the beginning.
Here are two screenshots just to make sure I’m not making a basic mistake.
These are my two lists (default and test)
And this is the subscribers list. Once I send the form, there should be another subscriber in the list, shouldn’t it?
Last edited by andreas (2007-07-30 17:04:28)
Offline