Skip to content

Instantly share code, notes, and snippets.


Shahjahan Jewel techjewel

View GitHub Profile
View get_tag_id_from_slug_fluentcrm.php
function myFluentCrmTagIdBySlug($slug) {
$tag = \FluentCrm\App\Models\Tag::where('slug', $slug)->first();
if($tag) {
$tagId = $tag->id;
View fluentcrm-redirect-after-confirmation.php
add_action('fluentcrm_confirmation_head', function ($subscriber) {
$redirectUrl = ''; // Change this url;
echo '<meta http-equiv="refresh" content="0; URL='.$redirectUrl.'" />';
View custom_background_queue_process.php
* Function to push a task for background processing
* @param: string $callbackName - Your classback acction name
* @param: mixed $payload - Your payload data that you will get when procssing on callback
function my_custom_queue_on_background($callbackName, $payload)
techjewel / fluencrm-contact-status-change.php
Last active Jun 14, 2021
FluentCRM update contact status programatically
View fluencrm-contact-status-change.php
function fcrmUpdateContactStatus($contactEmail, $newStatus) {
$contact = FluentCrmApi('contacts')->getContact($contactEmail);
if($contact) {
$oldStatus = $contact->status;
if($newStatus != $oldStatus) {
$contact->status = $newStatus;
do_action('fluentcrm_subscriber_status_to_' . $newStatus, $contact, $oldStatus);
techjewel / fluentcrm-postmark-support.php
Created May 3, 2021
Postmark SMTP header support for FluentCRM Emails
View fluentcrm-postmark-support.php
* Postmark SMTP header support for FluentCRM Emails
add_filter('fluentcrm_email_headers', function ($headers) {
$headers[] = 'X-PM-Message-Stream: broadcasts';
return $headers;
View new_form_submission_smartcode.php
* Fluent Forms Extra Smartcodes on form integration feeds
* This code will add a new item on the smartcode dropdown.
* if you don't want to show the smartcode then you may skip this.
add_filter('fluentform_form_settings_smartcodes', function ($groups) {
$groups[0]['shortcodes']['{my_custom_smartcode}'] = 'Custom All Data';
techjewel / protect_login_for_admin_roles.php
Last active Oct 28, 2021
Code snippet to reject login for admin/authors from the regular login url
View protect_login_for_admin_roles.php
* Code snippet to reject login for admin/authors from the regular login url
* In this example, people who have edit_posts permission is require special url string to login
* The URL need to be:
* For normal users they can login without the special salt
* But If author or admin try to login it will reject the authentication
View custom_date_smartcode.php
* Create custom smartcode for hidden field for the editor
* usage: {my_formatted_date_time}
* @return: current date time as d.m.Y H:i:s format
add_filter('fluentform_editor_shortcode_callback_my_formatted_date_time', function ($value) {
return date('d.m.Y H:i:s');
View dynamic_smartcode_in_fluentforms.php
* Smartcode callback for smartcode: {sondre_post_selection_meta}
add_filter('fluentform_shortcode_parser_callback_sondre_post_selection_meta', function ($returnValue, $instance) {
$userInputs = $instance::getInputs();
// from $userInputs you can access what user have provided information
// if your post selection input name is cpt_selection then you can access the post id as
$selectedPostId = $userInputs['cpt_selection'];
techjewel / fluentform-summary-email-hooks.php
Created Mar 1, 2021
Fluent Forms Summary Email Text Change
View fluentform-summary-email-hooks.php
// changing summary email body text
add_filter('fluentform_email_summary_body_text', function ($text) {
return 'Your own Email Body Text';
// changing email footer text
add_filter('fluentform_email_summary_footer_text', function ($text) {
return 'Powered by your agency';