I want to put the variable in the shortcode, but it is not working. What i have done wrong.
<?php $calendar = getCalendarTag();?>
<?php echo do_shortcode( '[ai1ec tag_name=".$calendar."]"]' ) ?>
Try changing your code to:
<?php echo do_shortcode('[ai1ec tag_name="' . $calendar . '"]'); ?>
Just use this line of code if you store shortcode in a variable:
<?php
$contact_popup_form = '[contact-form-7 id="91" title="Contact form"]';
echo do_shortcode($contact_popup_form);
?>
.and you also have an extra]. It should be'[ai1ec tag_name="' . $calendar . '"]';