GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
email.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display the Email field type
4  *
5  * @package GravityView
6  * @subpackage GravityView/templates/fields
7  */
8 
10 
11 extract( $gravityview_view->getCurrentField() );
12 
13 // If there's no email, don't bother continuing.
14 if( empty( $value ) ) {
15  return;
16 }
17 
18 // Default: plain email, no link
20 
21 if( !isset( $field_settings['emailmailto'] ) || !empty( $field_settings['emailmailto'] ) ) {
22 
23  $params = array();
24 
25  // The default link is a mailto link
26  $link = 'mailto:'.$value;
27 
28  // Is the subject set?
29  if( !empty( $field_settings['emailsubject'] ) ) {
30 
31  $subject = GravityView_API::replace_variables( $field_settings['emailsubject'], $form, $entry );
32 
33  $subject = wp_strip_all_tags( trim( do_shortcode( $subject ) ) );
34 
35  $params[] = 'subject='.str_replace('+', '%20', urlencode( $subject ) );
36  }
37 
38  // Is the body set?
39  if( !empty( $field_settings['emailbody'] ) ) {
40 
42 
43  $body = wp_strip_all_tags( trim( do_shortcode( $body ) ) );
44 
45  $params[] = 'body='.str_replace('+', '%20', urlencode( $body ) );
46  }
47 
48  // If the subject and body have been set, use them
49  if( !empty( $params) ) {
50  $link .= '?'.implode( '&', $params );
51  }
52 
53  // Generate the link HTML
55 
56 }
57 
58 /**
59  * Prevent encrypting emails no matter what - this is handy for DataTables exports, for example
60  * @since 1.1.6
61  * @var boolean
62  */
63 $prevent_encrypt = apply_filters( 'gravityview_email_prevent_encrypt', false );
64 
65 // If encrypting the link
66 if( !empty( $field_settings['emailencrypt'] ) && !$prevent_encrypt ) {
67 
69 
70 }
71 
72 echo $output;
static js_encrypt( $content, $message='')
Encrypt content using Javascript so that it&#39;s hidden when JS is disabled.
static getInstance( $passed_post=NULL)
$prevent_encrypt
Definition: email.php:63
$gravityview_view
Definition: email.php:9
$field_settings['content']
Definition: custom.php:27
gravityview_get_link( $href='', $anchor_text='', $atts=array())
Generate an HTML anchor tag with a list of supported attributes.
if( $add_query_args) $link
if(gravityview() ->plugin->is_GF_25()) $form
static replace_variables( $text, $form=array(), $entry=array(), $url_encode=false, $esc_html=true, $nl2br=true, $format='html', $aux_data=array())
Alias for GravityView_Merge_Tags::replace_variables()
Definition: class-api.php:118
$entry
Definition: notes.php:27
if(empty( $value)) $output
Definition: email.php:19