Iconnect.Umbraco.Utils
6.0.4
dotnet add package Iconnect.Umbraco.Utils --version 6.0.4
NuGet\Install-Package Iconnect.Umbraco.Utils -Version 6.0.4
<PackageReference Include="Iconnect.Umbraco.Utils" Version="6.0.4" />
<PackageVersion Include="Iconnect.Umbraco.Utils" Version="6.0.4" />
<PackageReference Include="Iconnect.Umbraco.Utils" />
paket add Iconnect.Umbraco.Utils --version 6.0.4
#r "nuget: Iconnect.Umbraco.Utils, 6.0.4"
#:package Iconnect.Umbraco.Utils@6.0.4
#addin nuget:?package=Iconnect.Umbraco.Utils&version=6.0.4
#tool nuget:?package=Iconnect.Umbraco.Utils&version=6.0.4
Email Service for Umbraco
The EmailService class is a versatile utility for handling email sending within Umbraco projects. It integrates with the SendGrid API for reliable email delivery and leverages Umbraco's content management capabilities for storing email templates and tracking sent emails.
Features
- SendGrid Integration: Utilizes the SendGrid API for sending emails, ensuring reliable delivery and tracking capabilities. Umbraco Content Management: Interacts with Umbraco's content management system to store email templates and track sent emails. Logging: Implements logging functionality to track email sending operations and handle errors gracefully.
- Template-based Email Sending: Allows sending emails based on predefined templates stored within Umbraco.
Dependecies
- SendGrid: Integration with the SendGrid API for email sending.
- Umbraco: Utilizes Umbraco's content management system for storing email templates and tracking sent emails.
- IHttpContextAccessor: Accesses the HTTP context for managing Umbraco requests.
- ILogger: Provides logging functionality to track email sending operations and handle errors.
- IConfiguration: Retrieves configuration settings required for email sending, such as SendGrid API key and SendGridFromEmail in appsettings.json "SendGrid": { "ApiKey": "", "SendGridFromEmail": "" },
Usage
Initialization
SendGrid API Key: Ensure you have a valid SendGrid API key and configure it in your application settings.
Inject Dependencies: When initializing the EmailService, inject all required dependencies such as Umbraco helpers, services, logger, and configuration. Sending Email
SendEmailUsingKey: Sends a single email using the provided email message and SendGrid API key.
SendMail: Sends an email and logs the operation, updating Umbraco content upon successful delivery. SendEmailNotificationUsingTemplate: Sends an email notification using a predefined template stored within Umbraco.
Create Document Type Email Emails as Parent Document Type with Email and Child with following Properties and Alias by adding in a permissions of Emails Document Type.
Email To Address(emailToAddress)
Email Sent(emailSent)
Email Sent Date (emailSentDate)
Email Subject (emailSubject )
Email Html Content (emailHtmlContent)
Email Text Content (emailTextContent)
Content Management Service
The ContentManagementService provides a set of functionalities to manage content within Umbraco CMS efficiently. It offers methods for querying, filtering, creating, and manipulating content items and media.
Features
- Content Retrieval: Retrieve content sections or specific nodes by document type alias or content type.
- Media Management: Create media items and set their properties programmatically.
- Content Search: Search and filter content based on document type alias or property values.
- Pagination: Paginate through large sets of content items for improved performance.
- Dynamic Content Retrieval: Retrieve content dynamically based on model type.
- Umbraco Context Integration: Utilizes Umbraco's context factory for seamless integration with the CMS.
Usage
- GetSectionUsingContentQuery: Retrieve a section of content using the
ContentQueryAPI. - GetSectionUsingUmbracoContext: Retrieve a content section using Umbraco's context factory.
- GetSectionByDocumentTypeAlias: Retrieve a section of content based on the document type alias.
- GetSpecificNodes: Retrieve specific nodes by name.
- GetDynamicContentByModelType: Retrieve dynamic content based on the model type.
- GetMediaCropsSectionUrl: Get the URL of media crops associated with a content node.
- GetCropUrls: Get URLs of image crops associated with a content node.
- SearchContent: Search for content items based on document type alias and name.
- FilterContent: Filter content based on document type alias and property values.
- PaginateContent: Paginate through content items for improved performance.
- LoadMoreContent: Load more content items using skip and take parameters.
- SearchContentByDocumentTypeAlias: Search for content items based on document type alias and name.
- CreateContentByDocumentAliasAsync: Create a new content item based on document type alias.
- CreateContentAsync: Create a new content item with specified property values.
- CreateChildContentAsync: Create a child content item under a parent content item with specified property values.
- CreateMediaContentAsync: Create a media item under a parent content item with specified property values.
Integration
This service integrates seamlessly with Umbraco CMS, utilizing Umbraco's core services such as UmbracoHelper, ContentTypeService, ContentService, MediaService, and more.
Note
Ensure proper configuration of Umbraco and necessary dependencies for the service to function correctly.
Media Upload Service
The MediaUploadService facilitates the management of media assets within Umbraco CMS, providing methods to upload media items from file uploads or URLs. It integrates seamlessly with Umbraco's media services and allows for efficient handling of media content.
Features
- Media Creation: Create media items from file uploads or URLs.
- File Upload Handling: Manage media uploads and set media item properties programmatically.
- URL Download: Download media content from external URLs and save it as media items.
- Media Folder Management: Organize media items into folders and handle media items with the same names.
- Integration with Umbraco Services: Utilizes Umbraco's media service and other core services for media management.
Usage
- CreateMediaItemFromFileUpload: Create a media item from a file upload, specifying the file path, parent ID, and media type alias.
- CreateMediaItemFromUrlAsync: Create a media item from a URL, providing the URL and media item name.
- DownloadImageAsync: Download an image asynchronously from a URL.
- HandleMediaWithTheSameNames: Handle media items with the same names within a folder.
Integration
This service integrates seamlessly with Umbraco CMS, utilizing Umbraco's media service, content type base service provider, media file manager, media URL generator collection, and other core services.
StripeService
Description:
The StripeService class provides methods for interacting with the Stripe payment platform. It allows for the creation of checkout sessions and processing of refunds using the Stripe API.
Methods:
CreateCheckoutSession
- Description: This method creates a checkout session for processing payments. Parameters:
- StripeCheckout options: An object containing checkout options such as amount, currency, product name, quantity, success URL, cancel URL, and secret key. Returns:
- Session: A Stripe session object representing the checkout session. RefundPayment
Description: This method processes refunds for previous payments. Parameters:
- StripeRefund refundOptions: An object containing refund options such as payment intent ID, amount to refund, and secret key. Returns: bool: True if the refund was successful, false otherwise. Usage:
Ensure that the necessary interfaces and models (IConnect.Umbraco.Utils.Interfaces, IConnect.Umbraco.Utils.Models) are imported. Import the Stripe namespace to access the Stripe API functionalities. Instantiate the StripeService class to utilize its methods for creating checkout sessions and processing refunds. Note:
The StripeService class assumes that the necessary Stripe API keys are provided in the options objects passed to the methods. Error handling is implemented to catch potential exceptions during the refund process and log appropriate messages. Ensure proper configuration and error handling in the calling code to handle any potential issues with the Stripe API interactions. Dependencies:
Stripe.NET SDK: Ensure that the Stripe.NET SDK is installed and referenced in the project to enable interaction with the Stripe API.
Example Usage: C#
// Instantiate StripeService
var stripeService = new StripeService();
// Create checkout session
var checkoutOptions = new StripeCheckout { Amount = 1000, // Amount in cents Currency = "usd", ProductName = "Product Name", Quantity = 1, SuccessUrl = "https://example.com/success", CancelUrl = "https://example.com/cancel", SecretKey = "your_stripe_secret_key" }; var session = stripeService.CreateCheckoutSession(checkoutOptions);
// Process refund
var refundOptions = new StripeRefund { PaymentIntentId = "payment_intent_id", AmountToRefund = 500, // Amount in dollars SecretKey = "your_stripe_secret_key" }; var refundResult = stripeService.RefundPayment(refundOptions);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- FluentValidation (>= 11.9.0)
- ImageProcessor (>= 2.9.0)
- Microsoft.AspNetCore.Authentication.Facebook (>= 6.0.27)
- Microsoft.AspNetCore.Authentication.Google (>= 6.0.27)
- SendGrid (>= 9.28.1)
- Serilog (>= 3.1.1)
- Stripe.net (>= 43.8.0)
- Umbraco.Cms (>= 10.7.0)
- Umbraco.Cms.Core (>= 10.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|