From 2b24ed5a341c2aae8bb7d3dc6351046bbfd001d6 Mon Sep 17 00:00:00 2001 From: James Hickey Date: Mon, 16 Dec 2024 16:06:11 +0000 Subject: [PATCH] fix tests in GH actions + docs --- .github/workflows/dotnet.yml | 36 ------------------- Demo/Demo.csproj | 2 +- DocsV2/docs/Mailing/README.md | 30 ++++++++++++++++ .../TestMvcApp/TestMvcApp.csproj | 2 +- Src/IntegrationTests/Tests/Tests.csproj | 2 +- .../CoravelUnitTests/CoravelUnitTests.csproj | 2 +- .../MailerUnitTests/MailerUnitTests.csproj | 2 +- 7 files changed, 35 insertions(+), 41 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index e955bda6..9d353bc1 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -7,42 +7,6 @@ on: branches: [ master ] jobs: - build_and_tests_on_dotnet_6: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 6.0.x - - name: Restore dependencies - run: dotnet restore ./Src/All.sln - - name: Build - run: dotnet build ./Src/All.sln - - name: Mailer Tests - run: dotnet test ./Src/UnitTests/MailerUnitTests/MailerUnitTests.csproj - - name: Unit Tests - run: dotnet test ./Src/UnitTests/CoravelUnitTests/CoravelUnitTests.csproj - - name: Integration Tests - run: dotnet test ./Src/IntegrationTests/Tests/Tests.csproj - build_and_tests_on_dotnet_7: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x - - name: Restore dependencies - run: dotnet restore ./Src/All.sln - - name: Build - run: dotnet build ./Src/All.sln - - name: Mailer Tests - run: dotnet test ./Src/UnitTests/MailerUnitTests/MailerUnitTests.csproj - - name: Unit Tests - run: dotnet test ./Src/UnitTests/CoravelUnitTests/CoravelUnitTests.csproj - - name: Integration Tests - run: dotnet test ./Src/IntegrationTests/Tests/Tests.csproj build_and_tests_on_dotnet_8: runs-on: ubuntu-latest steps: diff --git a/Demo/Demo.csproj b/Demo/Demo.csproj index a7fc9910..ec328b8d 100644 --- a/Demo/Demo.csproj +++ b/Demo/Demo.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 Linux True diff --git a/DocsV2/docs/Mailing/README.md b/DocsV2/docs/Mailing/README.md index ddc16d4f..3ba8c2e6 100644 --- a/DocsV2/docs/Mailing/README.md +++ b/DocsV2/docs/Mailing/README.md @@ -345,6 +345,36 @@ Sender("test@test.com") Attach multiple files by passing an `Attachment` to the `Attach()` method. +Each attachment has a few fields to assign: + +- `Bytes`: The `byte[]` of the file you are attaching. +- `Name`: The name of the file to attach. +- `ContentId`: Often used for embedding images into emails. Assign a value that is unique within your email template. + +##### Embedding Images + +To embed images into your email you can assign the `ContentId` field with a unique value that will also be used in your email. + +For example: + +```csharp +emailMessage + .Attach(new Attachment + { + Name = "My Image", + Bytes = myBytes, + ContentId = "my-image" + }); +``` + +```html + + + +``` + +Coravel will automatically link the embedded resources to the email properly for you. + #### Auto-Detect Email Address And Name Using an `object` that has a `public` field or property `Email` and `Name`, you can pass it to the `To()` method. diff --git a/Src/IntegrationTests/TestMvcApp/TestMvcApp.csproj b/Src/IntegrationTests/TestMvcApp/TestMvcApp.csproj index 79f7970a..d00c9117 100644 --- a/Src/IntegrationTests/TestMvcApp/TestMvcApp.csproj +++ b/Src/IntegrationTests/TestMvcApp/TestMvcApp.csproj @@ -1,7 +1,7 @@  - .net6.0 + .net8.0 diff --git a/Src/IntegrationTests/Tests/Tests.csproj b/Src/IntegrationTests/Tests/Tests.csproj index cc6693f8..61da05bf 100644 --- a/Src/IntegrationTests/Tests/Tests.csproj +++ b/Src/IntegrationTests/Tests/Tests.csproj @@ -1,7 +1,7 @@  - .net6.0 + .net8.0 false diff --git a/Src/UnitTests/CoravelUnitTests/CoravelUnitTests.csproj b/Src/UnitTests/CoravelUnitTests/CoravelUnitTests.csproj index 987768d5..2e433645 100644 --- a/Src/UnitTests/CoravelUnitTests/CoravelUnitTests.csproj +++ b/Src/UnitTests/CoravelUnitTests/CoravelUnitTests.csproj @@ -1,7 +1,7 @@  - .net6.0 + .net8.0 false diff --git a/Src/UnitTests/MailerUnitTests/MailerUnitTests.csproj b/Src/UnitTests/MailerUnitTests/MailerUnitTests.csproj index 063301cb..838b864f 100644 --- a/Src/UnitTests/MailerUnitTests/MailerUnitTests.csproj +++ b/Src/UnitTests/MailerUnitTests/MailerUnitTests.csproj @@ -1,7 +1,7 @@ - .net6.0 + .net8.0 false