eaacaadmin
Forum Replies Created
-
Finally
Does smtp plugin support sending attachments?
with another message
I received an email with an attachment, but the problem was that the attached file had 0 bytes.
To my surprise, after comparing the source of the email with the source of an email with a complete attachment, I found out the problem: before the actual content of the attachment ($attachment) there should be an empty line.
I replaced the line of code:$message .= “\r\nContent-Disposition: attachment\r\n”.$attachment.”\r\n”;
with:
?
1$message .= “\r\nContent-Disposition: attachment\r\n\r\n”.$attachment.”\r\n”; // notice the double \r\n
and it worked! This way I received the email with the correct attachment.
This is what I found online
$headers = “MIME-Version: 1.0\r\n”;
$headers .= “To: <“.$to_email.”>\r\n”;
$headers .= “From: “.$from_name.” <“.$from_email.”>”;
$random_hash = md5(date(‘r’, time()));
// add boundary string and mime type specification
$headers .= “\r\nContent-Type: multipart/mixed; boundary=\”PHP-mixed-“.$random_hash.”\””;
// read the atachment file contents from a string previously formed,
// encode it with MIME base64,
// and split it into smaller chunks
$attachment = chunk_split(base64_encode($content));
// construct the body of the message
$message = “–PHP-mixed-“.$random_hash;
// my attachment was an html file
$message .= “\r\nContent-Type: text/html; name=\””.$filename.”\””;
$message .= “\r\nContent-Transfer-Encoding: base64”;
$message .= “\r\nContent-Disposition: attachment\r\n”.$attachment.”\r\n”;
$message .= “\r\n–PHP-mixed-“.$random_hash.”–“;
// Windows
ini_set(‘sendmail_from’, $return_email);
mail($to_email, addslashes($subject), $message, $headers);
ini_restore(‘sendmail_from’);
// Linux
// mail($to_email, addslashes($subject), $message, $headers, “-r “.$return_email);The current workaround is :
to not select the enable number format in the list field. Instead create another number field with calculation enabled which populates the total of the list field column with number data in it. Works fine that way but it would be great if number format in List field becomes fully compatible with Nested forms@ovann86 Thanks anyway for the awesome work
To update you if I don’t select “Enable number format option” then the list field works correctly
If I enable number format for any of the columns then clicking the + sign does not create additional rows addition of rows. It just wont add new rows.
This applies to when the list field is used in Nested forms
Hi @ovann86
List field number format is not compatible with Nested forms yet I guess
The below issue still persists. Thanks
URL: https://192.168.1.117:82/wordpress/wp-content/plugins/list-field-number-format-for-gravity-forms/js/itsg_gf_listnumformat_js.js?ver=1901699164 Line Number: 409
In Future versions – If Possible, you could provide for predefined choices option …so that entering numerous choices becomes just copy paste instead of having to type each option as it is now
ThanksSo yes apparently with 1.8.5 works fine.
Thank you.Forum: Plugins
In reply to: [Code Snippets] snippet-ops.php(355) : eval()’d code on line 14Hi Shea thank you for this amazing plugin.
The code below returns this error
Cannot redeclare enable_list_input_mask() (previously declared in F:\Bitnami\wordpress-4.9.8-1\apps\wordpress\htdocs\wp-content\plugins\code-snippets\php\snippet-ops.php(361) : eval()’d code:3)
What does this error mean?…
Code:
// enable input mask for form #44 list field #40 columns 1
add_filter(‘gform_register_init_scripts_44’, ‘enable_list_input_mask’);
function enable_list_input_mask($form) {
$field_id = “40”; //set field id here
$col_id = array(‘1’); //set column id here
$mask = “99-9999”; //define mask here, examples at https://www.gravityhelp.com/documentation/page/Input_Mask
//that’s it nothing more to configure$c_sel = array();
foreach($col_id as $c) {
$c_sel[] = “.gfield_list_{$field_id}_cell{$c} input”;
}
$c_sels = json_encode($c_sel);
$im_script = “jQuery(sel.join()).mask(‘{$mask}’);”;
$script = “var sel = {$c_sels}; {$im_script} jQuery(‘#field_{$form[“id”]}_{$field_id}’).on(‘click’, ‘.add_list_item’, function(){{$im_script}});”;
GFFormDisplay::add_init_script($form[‘id’], ‘list_input_mask’, GFFormDisplay::ON_PAGE_RENDER, $script);
return $form;
}
add_action( ‘gform_enqueue_scripts_44’, ‘list_masked_input_script’, 10, 2 );
function list_masked_input_script( $form ) {
wp_enqueue_script( ‘gform_masked_input’, array( ‘jquery’ ), false, true );
}Forum: Plugins
In reply to: [SV Gravity Forms Enhancer] Doesnt Support Populate anything by Gravity WizP.S.: The email population field stopped working (Populate anything)
P.S. To spell out the issue exactly : the plugin wont allow addition of more rows in case of more than one list field when more than one form one page
The Plugin author has resolved this in the latest update to this plugin
This means that this plugin cannot be used in the gravity forms eco system especially after the introduction of the Nested Field for gravity forms, if we plan using the LIST field, until when you get the time to update the plugin to resolve this issue.
Hi there
We identified the issue. It took a while to identify. Credit goes to David Smith of gravitywiz and could be identified when we were using the Nested forms add on for gravity forms. The bug is that the number format gravity forms plugin is configured in such a way that you can’t have multiple forms on the same page. But I guess we can have multiple forms on the same page. So this means that if we use this plugin on a page with multiple forms it would inevitably at some point throw up this error. List field number format for gravity forms is an intricate problem solving piece of software. Since this software has done this work that no one else has done and with requests to introduce more such customizations you could consider offering these services for a reasonable consideration. Thanks.
Yes it did.
Error: TypeError: number_format_fields[field_id] is undefined URL: https://192.168.1.117:82/wordpress/wp-content/plugins/list-field-number-format-for-gravity-forms/js/itsg_gf_listnumformat_js.js?ver=1901699164 Line Number: 409
Thank you