plainblack.com
Username Password
search
Bookmark and Share

    

Get raw email submitted in Data Form

User vanjwilson
Date 4/25/2012 10:08 pm
Views 749
Rating -1    Rate [
|
]
Previous · Next
User Message
vanjwilson

I need to get the raw email submitted in a Data Form field to use in a custom macro in the Acknowledgement template.

When I use:

    <tmpl_var field.noloop.email.value>

I get:

   <a href="jdoe@example.com">jdoe@example.com</a>

When what I want, and expected is:

    jdoe@example.com

I believe this is coming from this subroutine in /Form/Email.pm:

sub getValueAsHtml {
    my $self = shift;
    my $email = $self->getOriginalValue;
    return '<a href="mailto:'.$email.'">'.$email.'</a>';
}


How can I get just the email, without the HTML markup, to use in my template?

--- (Edited on 4/25/2012 10:08 pm [GMT-0500] by vanjwilson) ---



Back to Top
Rate [
|
]
 
 
vanjwilson

I ended up using the macro first published by Arjan in this post:

    http://www.webgui.org/web_design_templates_and_themes/strip-html-in-a-sql-query-or-macro/2

This solution is over 4 years old. I can't believe there is not an alternative template var in WebGUI for raw email by now. Am I just overlooking it in the docs?

--- (Edited on 4/26/2012 9:26 pm [GMT-0500] by vanjwilson) ---



Back to Top
Rate [
|
]
 
 
susanb

Doesn't look like anyone ever requested it as a feature, so that would explain about it never getting fixed in core. :-(

Susan B

--- (Edited on 4/30/2012 10:53 [GMT-0700] by susanb) ---



Back to Top
Rate [
|
]
 
 
© 2014 Plain Black Corporation | All Rights Reserved