ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Moblogs and email addresses with @ signs

June 03, 2009 3:07am

Subscribe [3]
  • #1 / Jun 03, 2009 3:07am

    mayest

    293 posts

    I’m using FreeForm to create a SAEF. It sends the data that was entered to an email address, which is used by the moblog to populate an entry. This is working pretty well, except for one thing:

    One of the fields in the form is for the user’s email address. The email address is included properly in the email sent by FreeForm, but if it has an @ in it then it doesn’t get posted to the weblog.

    So, if I enter .(JavaScript must be enabled to view this email address) for the email address then it doesn’t post the email address (everything else is fine).

    On the other hand, if I use me at example.com for the address then it is properly posted to the field.

    So, it seems that the moblog module is ignoring any field that contains an @ sign. Is there a known fix for this? Surely people send email addresses via moblog, right?

    A related problem occurs if I type an @ into my description (body) field. Only in this case, FreeForm won’t even send the email for some reason.

    There seems to be something going on with @ signs. Any ideas? In the weblog preferences I turned off the option to automatically convert email addresses into links. That didn’t help.

    I’m using the very latest build of EE 1.67 (downloaded and upgraded yesterday).

    Thanks!

    EDIT: I have to amend this. FreeForm does send the email if there is an @ sign in the description field. However, it takes a looong time to arrive for some reason. It even posted the text with the @ sign in the description. It is only the email field (textarea, as required) that is left empty. I tested several posts without the @ sign in the description and they went through immediately. Weird.

  • #2 / Jun 03, 2009 4:18am

    Ingmar

    29245 posts

    So you are using Freeform, not the SAEF, is that correct? Can you try to take Freeform out of the equation for a moment and try to send the mail to your the moblog module yourself? Does that work?

  • #3 / Jun 03, 2009 4:32am

    mayest

    293 posts

    Ingmar,

    Right, I’m using FreeForm instead of SAEF. I just sent an email directly, and I get the same behavior as going through FreeForm. Everything posts correctly, except for the email address (which is just left blank). Here is the email that I sent:

    {entry_title}I have a Dream{/entry_title}
    
    {field:user_screen_name format="none"}mayest{/field:user_screen_name}
    
    {field:user_real_name format="none"}Tim Mayes{/field:user_real_name}
    
    {field:user_email_address format="none"}[email protected]{/field:user_email_address}
    
    {field:description format="none"}This is a test for Ingmar{/field:description}
  • #4 / Jun 03, 2009 8:32am

    Sue Crocker

    26054 posts

    What kind of field is user_email_address?

    Is it a textarea? If not, you’ll need to make the following config.php change:

    EEWiki:// Moblog Allow NonTextareas

  • #5 / Jun 03, 2009 4:11pm

    mayest

    293 posts

    Sue, yes it is a textarea. It is defined to have only 1 row because I wanted it to look like a text input when I go to edit an entry. That config.php setting is something that I didn’t know about, but I may use it at some point in the future.

    BTW, I just tried sending the email address enclosed in quotes, but that didn’t do anything. Also, I CAN directly type in the email address into that field when I edit the post through the CP Edit tab.

    So, it seems that the moblog module is doing something, and it only affects that field. I just tried including an email address in the description and it came through just fine for that field, but it again left the user_email_address field blank.

  • #6 / Jun 03, 2009 4:27pm

    mayest

    293 posts

    I just tried a new idea, but it didn’t help. I deleted the user_email_address field from the field group and then recreated it. I was thinking that it might somehow be stuck in the database as a text input instead of a textarea. As I said, this didn’t change anything.

    I also took a look at the entries in the FreeForm control panel, and it does have the email addresses. So, again, it really seems to be a problem with the moblog module. Of course, it could be user error but I have no idea what I might be doing wrong.

    Grrrr. This is getting more bizarre. I just tried sending another email, this time using an email address in the user_real_name field. Naturally, that worked perfectly. But I don’t want the email address in that field.

  • #7 / Jun 03, 2009 5:21pm

    Sue Crocker

    26054 posts

    Grrrr. This is getting more bizarre. I just tried sending another email, this time using an email address in the user_real_name field. Naturally, that worked perfectly. But I don’t want the email address in that field.

    How do the two fields differ?

    Which build/version of ExpressionEngine are you using? You can find this information at the bottom of any control panel page.

    What about extensions?

  • #8 / Jun 03, 2009 6:31pm

    silenz

    1651 posts

    I tried and couldn’t replicate the problem so far but wanted to pop in to thank you for sharing this approach (Freeform/Moblog-combo) in general.

    I think I might be using it in some future projects.

  • #9 / Jun 03, 2009 7:20pm

    mayest

    293 posts

    @silenz, thanks for trying to replicate the problem. I’m getting the idea that it is probably user error (me!), but I can’t find anything wrong. Its just that one field.

    Anyway, I stole that FreeForm -> moblog technique from the Solspace FreeForm forum. Not having any previous experience with creating forms or the moblog module, it was a bit of a slog for me. But it works very well, except for my one issue.

  • #10 / Jun 03, 2009 7:28pm

    mayest

    293 posts

    Maybe somebody can spot an error in my setup. Here is the moblog template:

    {entry_title}{title}{/entry_title}
    
    {field:user_screen_name format="none"}{text}{/field:user_screen_name}
    
    {field:user_real_name format="none"}{text}{/field:user_real_name}
    
    {field:user_email_address format="none"}{text}{/field:user_email_address}
    
    {field:description format="none"}{text}{/field:description}

    Also I posted an example of the email a few posts back. Again, that user_email_address field works perfectly as long as there isn’t an @ sign sent to it.

  • #11 / Jun 03, 2009 7:46pm

    mayest

    293 posts

    Grrrr. This is getting more bizarre. I just tried sending another email, this time using an email address in the user_real_name field. Naturally, that worked perfectly. But I don’t want the email address in that field.

    How do the two fields differ?

    Which build/version of ExpressionEngine are you using? You can find this information at the bottom of any control panel page.

    What about extensions?

    Sue, sorry I missed your message. The two fields (user_real_name and user_email_address) are defined identically. See attached images. The only difference is their display order.

  • #12 / Jun 03, 2009 7:50pm

    Greg Aker

    6022 posts

    What are the differences between the user_real_name & user_email_address fields?

  • #13 / Jun 03, 2009 8:15pm

    mayest

    293 posts

    Greg, looks like we posted at about the same time. Do the pictures in the post before yours answer the question, or are you asking about something else?

    I’m seriously considering just dropping the user_email_address field. In the form, it is pre-populated as are the user_screen_name and user-real_name fields. Since users have to be logged in to see the form, I can probably display the email address in the template that I will use to view this weblog. Right?

    That wouldn’t be ideal. I want their email address specifically so that I can send messages to that address, which might be different from the one that I have in the database for them.

  • #14 / Jun 03, 2009 8:36pm

    Greg Aker

    6022 posts

    ah, looks like we cross-posted.

    Let’s try a couple of tests.  Can you submit a few with some differences in that field.  eg:

    @
    @me
    me @ example.com
    me @example.com
    me@ example.com

    let’s see if any of those get through..

    -greg

  • #15 / Jun 03, 2009 9:45pm

    mayest

    293 posts

    Greg, none of those variations are getting posted to the user_email_address field. Everything else, as always, goes into the correct field.

    Just for grins, I tried using me&example;.com and me*example.com (note the & and * instead of @). No go. For whatever reason, it seems that field doesn’t like any of those characters.

    Is it possible that there is some kind of MySQL injection (not sure of the correct terminology) protection or other security filtering going on? I would have thought that might be the case, but since @ gets through to the other fields I don’t think so. It really seems like there is something different about that one field, but I don’t see what it could be.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases