FormFields
2 years ago
FormTemplate
2 years ago
ActiveCampaign.php
2 years ago
ConstantContact.php
2 years ago
ConvertKit.php
2 years ago
CurrencySwitcher.php
2 years ago
DonationGoal.php
2 years ago
DonationOptions.php
2 years ago
DoubleTheDonation.php
2 years ago
EmailSettings.php
2 years ago
FeeRecovery.php
2 years ago
FormExcerpt.php
2 years ago
FormFeaturedImage.php
2 years ago
FormFieldManager.php
2 years ago
FormFields.php
2 years ago
FormGrid.php
2 years ago
FormMeta.php
2 years ago
FormTitle.php
2 years ago
FundsAndDesignations.php
2 years ago
GiftAid.php
2 years ago
Mailchimp.php
2 years ago
MigrateMeta.php
2 years ago
OfflineDonations.php
2 years ago
PaymentGateways.php
2 years ago
PdfSettings.php
2 years ago
PerFormGateways.php
2 years ago
RazorpayPerFormSettings.php
1 year ago
RecurringDonationOptions.php
2 years ago
TermsAndConditions.php
2 years ago
ConvertKit.php
48 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\FormMigration\Steps; |
| 4 | |
| 5 | use Give\FormMigration\Contracts\FormMigrationStep; |
| 6 | use Give\Framework\Blocks\BlockModel; |
| 7 | use Give\Log\Log; |
| 8 | |
| 9 | /** |
| 10 | * @since 3.11.0 |
| 11 | */ |
| 12 | class ConvertKit extends FormMigrationStep |
| 13 | { |
| 14 | /** |
| 15 | * @since 3.11.0 |
| 16 | */ |
| 17 | public function canHandle(): bool |
| 18 | { |
| 19 | return $this->formV2->isConvertKitEnabled(); |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @since 3.11.0 |
| 24 | */ |
| 25 | public function process(): void |
| 26 | { |
| 27 | $block = BlockModel::make([ |
| 28 | 'name' => 'givewp-convertkit/convertkit', |
| 29 | 'attributes' => $this->getAttributes() |
| 30 | ]); |
| 31 | |
| 32 | $this->fieldBlocks->insertAfter('givewp/email', $block); |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * @since 3.11.0 |
| 37 | */ |
| 38 | private function getAttributes(): array |
| 39 | { |
| 40 | return [ |
| 41 | 'label' => $this->formV2->getConvertKitLabel() , |
| 42 | 'defaultChecked' => $this->formV2->getConvertKitDefaultChecked(), |
| 43 | 'selectedForm' => $this->formV2->getConvertKitSelectedForm(), |
| 44 | 'tagSubscribers' => $this->formV2->getConvertKitTags() |
| 45 | ]; |
| 46 | } |
| 47 | } |
| 48 |